1 Les motifs de Svb sont compris dans les fenêtre de 6kb (± 3kb)

1.1 Determination des motifs ayant de la fixation ou non

La recherche des motifs présentant de la fixation de Shavenbaby se fait en comparant les motifss ovoQ6 et svbF7 ( en les augmentant de 3kb ( start - 3kb / end + 3kb )) et les peaks Svb ( avec un peak-calling avec des sensibilités différentes ( q= 10-1 (stringent) ; q=10-4 (sensibily or low)) )

load("Myworkspace.RData")
svbF7_cons = read.table("/Users/alexmanchenoferris/Documents/motif_svb/svbF7_cons_flanked_dm6.bed")
ovoQ6_droso = read.table("/Users/alexmanchenoferris/Documents/motif_svb/ovoQ6_droso_flanked_dm6.bed")

svbF7_cons_gr = GRanges(seqnames = Rle(svbF7_cons$chr), 
                     ranges=IRanges(start = svbF7_cons$start,end = svbF7_cons$end, names = paste(rep("svbF7_cons",nrow(svbF7_cons)),rownames(svbF7_cons), sep = "_")))

ovoQ6_droso_gr_unique = unique(GRanges(seqnames = Rle(ovoQ6_droso$chr), 
                     ranges=IRanges(start = ovoQ6_droso$start,end = ovoQ6_droso$end, names = paste(rep("ovoQ6_droso",nrow(unique(ovoQ6_droso))),rownames(ovoQ6_droso), sep = "_"))))






SvbACT_peaks_low = read.table("/Users/alexmanchenoferris/Documents/Chipseq_ActRep/macs/low_quality/macs_1B_peaks.xls",sep = "\t", comment.char = "#", header = T, stringsAsFactors = F)

SvbACT.peaks_low = GRanges(seqnames = Rle(SvbACT_peaks_low[,1]), 
                     ranges=IRanges(start = SvbACT_peaks_low[,2],end = SvbACT_peaks_low[,3], names = SvbACT_peaks_low[,10]),
                     strand = Rle(rep("*",nrow(SvbACT_peaks_low))),
                     score = SvbACT_peaks_low[,7],
                   fold_enrichment = SvbACT_peaks_low[,8])



SvbACT_peaks_embryo = read.table("/Users/alexmanchenoferris/Documents/Chipseq_ActRep/macs/embryo/macs_svb_01_peaks.xls",sep = "\t", comment.char = "#", header = T, stringsAsFactors = F)



SvbACT.peaks_embryo = GRanges(seqnames = Rle(SvbACT_peaks_embryo[,1]), 
                     ranges=IRanges(start = SvbACT_peaks_embryo[,2],end = SvbACT_peaks_embryo[,3], names = SvbACT_peaks_embryo[,10]),
                     strand = Rle(rep("*",nrow(SvbACT_peaks_embryo))),
                     score = SvbACT_peaks_embryo[,7],
                   fold_enrichment = SvbACT_peaks_embryo[,8])

SvbACT_peaks_associated = read.table("/Users/alexmanchenoferris/Documents/ListeGene/peak_associed_geneDE/coordonnees_peak_associed_gene_diff_0-5kb.bed",sep = "\t", comment.char = "#", header = T, stringsAsFactors = F)



SvbACT.peaks_assiociated = GRanges(seqnames = Rle(SvbACT_peaks_associated[,1]), 
                     ranges=IRanges(start = SvbACT_peaks_associated[,2],end = SvbACT_peaks_associated[,3], names = SvbACT_peaks_associated$names),
                     strand = Rle(rep("*",nrow(SvbACT_peaks_associated))),
                     score = SvbACT_peaks_associated$scores,
                   fold_enrichment = SvbACT_peaks_associated$fold)

promoters_directgenes = read.table("/Users/alexmanchenoferris/Documents/ListeGene/direct_target_gene_coordonnees/promoters_gene_0_5b_tab.bed")
colnames(promoters_directgenes) = c("chr","start","end","length","strand")
promoters_directgenes_gr = GRanges(seqnames = Rle(promoters_directgenes$chr), 
                     ranges=IRanges(start = promoters_directgenes$start,end = promoters_directgenes$end, names = paste(rep("promoters",nrow(promoters_directgenes)),rownames(promoters_directgenes), sep = "_")))


# en flankant les motifs de 300kb ( taille moyenne des pics )
svbF7_cons_300 = read.table("/Users/alexmanchenoferris/Documents/motif_svb/300pb/svbF7_cons.bed")
ovoQ6_droso_300 = read.table("/Users/alexmanchenoferris/Documents/motif_svb/300pb/ovoQ6.bed")
colnames(ovoQ6_droso_300) = c("chr","start","end")
colnames(svbF7_cons_300) = c("chr","start","end")

svbF7_cons_gr_300 = GRanges(seqnames = Rle(svbF7_cons_300$chr), 
                     ranges=IRanges(start = svbF7_cons_300$start,end = svbF7_cons_300$end, names = paste(rep("svbF7_cons",nrow(svbF7_cons_300)),rownames(svbF7_cons_300), sep = "_")))

ovoQ6_droso_gr_unique_300 = unique(GRanges(seqnames = Rle(ovoQ6_droso_300$chr), 
                     ranges=IRanges(start = ovoQ6_droso_300$start,end = ovoQ6_droso_300$end, names = paste(rep("ovoQ6_droso",nrow(unique(ovoQ6_droso_300))),rownames(ovoQ6_droso_300), sep = "_"))))

1.1.1 Stringent

## $p.value
##      SvbAct ovoQ6 svbF7 pval
## [1,]      0     1     1  NaN
## [2,]      1     0     1  NaN
## [3,]      1     1     0  NaN
## 
## $vennCounts
##      SvbAct ovoQ6 svbF7 Counts count.B1.peaks count.ovoQ6_droso_gr_unique
## [1,]      0     0     0 -45933              0                           0
## [2,]      0     0     1    182              0                           0
## [3,]      0     1     0  39903              0                       39903
## [4,]      0     1     1   1223              0                        8039
## [5,]      1     0     0    829            829                           0
## [6,]      1     0     1     63             94                           0
## [7,]      1     1     0   3076           3103                       10374
## [8,]      1     1     1    757           1486                        7207
##      count.svbF7_cons_gr
## [1,]                   0
## [2,]                 182
## [3,]                   0
## [4,]                1223
## [5,]                   0
## [6,]                  69
## [7,]                   0
## [8,]                 880
## attr(,"class")
## [1] "VennCounts"

## $p.value
##      SvbAct ovoQ6 pval
## [1,]      1     1  NaN
## 
## $vennCounts
##      SvbAct ovoQ6 Counts count.B1.peaks count.ovoQ6_droso_gr_unique
## [1,]      0     0 -55740              0                           0
## [2,]      0     1  50359              0                       50359
## [3,]      1     0    925            925                           0
## [4,]      1     1   4556           4587                       15164
## attr(,"class")
## [1] "VennCounts"

## $p.value
##      SvbAct svbF7 pval
## [1,]      1     1  NaN
## 
## $vennCounts
##      SvbAct svbF7 Counts count.B1.peaks count.svbF7_cons_gr
## [1,]      0     0  -6859              0                   0
## [2,]      0     1   1751              0                1751
## [3,]      1     0   4652           4652                   0
## [4,]      1     1    556            860                 603
## attr(,"class")
## [1] "VennCounts"
svbF7_motifs_unbound = as.data.frame(svbF7_cons_gr_svb_bind_overlap$peaklist$svbF7_cons_gr)

svbF7_motifs_bound = as.data.frame(svbF7_cons_gr_svb_bind_overlap$peaklist$`B1.peaks///svbF7_cons_gr`)

ovoQ6_motifs_unbound = as.data.frame(ovoQ6_droso_svb_bind_overlap$peaklist$ovoQ6_droso_gr_unique)

ovoQ6_motifs_bound = as.data.frame(ovoQ6_droso_svb_bind_overlap$peaklist$`B1.peaks///ovoQ6_droso_gr_unique`)

1.1.2 Sensible

## $p.value
##      SvbAct ovoQ6.motif svbF7 pval
## [1,]      0           1     1  NaN
## [2,]      1           0     1  NaN
## [3,]      1           1     0  NaN
## 
## $vennCounts
##      SvbAct ovoQ6.motif svbF7 Counts count.SvbACT.peaks_low
## [1,]      0           0     0 -44598                      0
## [2,]      0           0     1    175                      0
## [3,]      0           1     0  37562                      0
## [4,]      0           1     1   1119                      0
## [5,]      1           0     0   1009                   1009
## [6,]      1           0     1     70                    111
## [7,]      1           1     0   3907                   3946
## [8,]      1           1     1    856                   1872
##      count.ovoQ6_droso_gr_unique count.svbF7_cons_gr
## [1,]                           0                   0
## [2,]                           0                 175
## [3,]                       37562                   0
## [4,]                        7263                1119
## [5,]                           0                   0
## [6,]                           0                  76
## [7,]                       12383                   0
## [8,]                        8315                 984
## attr(,"class")
## [1] "VennCounts"

## $p.value
##      SvbAct ovoQ6 pval
## [1,]      1     1  NaN
## 
## $vennCounts
##      SvbAct ovoQ6 Counts count.SvbACT.peaks_low count.ovoQ6_droso_gr_unique
## [1,]      0     0 -54247                      0                           0
## [2,]      0     1  47459                      0                       47459
## [3,]      1     0   1121                   1121                           0
## [4,]      1     1   5767                   5817                       18064
## attr(,"class")
## [1] "VennCounts"

## $p.value
##      SvbAct svbF7 pval
## [1,]      1     1  NaN
## 
## $vennCounts
##      SvbAct svbF7 Counts count.SvbACT.peaks_low count.svbF7_cons_gr
## [1,]      0     0  -8112                      0                   0
## [2,]      0     1   1671                      0                1671
## [3,]      1     0   5912                   5912                   0
## [4,]      1     1    629                   1026                 683
## attr(,"class")
## [1] "VennCounts"

1.1.3 Dans les embryons

## $p.value
##      SvbAct ovoQ6 svbF7 pval
## [1,]      0     1     1  NaN
## [2,]      1     0     1  NaN
## [3,]      1     1     0  NaN
## 
## $vennCounts
##      SvbAct ovoQ6 svbF7 Counts count.SvbACT.peaks_embryo
## [1,]      0     0     0 -42353                         0
## [2,]      0     0     1    151                         0
## [3,]      0     1     0  34214                         0
## [4,]      0     1     1    672                         0
## [5,]      1     0     0   1228                      1228
## [6,]      1     0     1     95                       133
## [7,]      1     1     0   4855                      4915
## [8,]      1     1     1   1238                      2430
##      count.ovoQ6_droso_gr_unique count.svbF7_cons_gr
## [1,]                           0                   0
## [2,]                           0                 151
## [3,]                       34214                   0
## [4,]                        4420                 672
## [5,]                           0                   0
## [6,]                           0                 100
## [7,]                       15239                   0
## [8,]                       11650                1431
## attr(,"class")
## [1] "VennCounts"

## $p.value
##      SvbAct ovoQ6 pval
## [1,]      1     1  NaN
## 
## $vennCounts
##      SvbAct ovoQ6 Counts count.SvbACT.peaks_embryo count.ovoQ6_droso_gr_unique
## [1,]      0     0 -50909                         0                           0
## [2,]      0     1  42375                         0                       42375
## [3,]      1     0   1365                      1365                           0
## [4,]      1     1   7269                      7341                       23148
## attr(,"class")
## [1] "VennCounts"

## $p.value
##      SvbAct svbF7 pval
## [1,]      1     1  NaN
## 
## $vennCounts
##      SvbAct svbF7 Counts count.SvbACT.peaks_embryo count.svbF7_cons_gr
## [1,]      0     0  -9557                         0                   0
## [2,]      0     1   1359                         0                1359
## [3,]      1     0   7379                      7379                   0
## [4,]      1     1    919                      1327                 995
## attr(,"class")
## [1] "VennCounts"

1.1.4 Dans les peaks associés aux gènes cibles

## $p.value
##      SvbAct ovoQ6 svbF7 pval
## [1,]      0     1     1  NaN
## [2,]      1     0     1  NaN
## [3,]      1     1     0  NaN
## 
## $vennCounts
##      SvbAct ovoQ6 svbF7 Counts count.unique.SvbACT.peaks_assiociated.
## [1,]      0     0     0 -52876                                      0
## [2,]      0     0     1    245                                      0
## [3,]      0     1     0  50359                                      0
## [4,]      0     1     1   2012                                      0
## [5,]      1     0     0     67                                     67
## [6,]      1     0     1      5                                      5
## [7,]      1     1     0    220                                    220
## [8,]      1     1     1     68                                     93
##      count.ovoQ6_droso_gr_unique count.svbF7_cons_gr
## [1,]                           0                   0
## [2,]                           0                 245
## [3,]                       50359                   0
## [4,]                       13531                2012
## [5,]                           0                   0
## [6,]                           0                   6
## [7,]                         906                   0
## [8,]                         727                  91
## attr(,"class")
## [1] "VennCounts"

## $p.value
##      SvbAct ovoQ6 pval
## [1,]      1     1  NaN
## 
## $vennCounts
##      SvbAct ovoQ6 Counts count.unique.SvbACT.peaks_assiociated.
## [1,]      0     0 -64497                                      0
## [2,]      0     1  64212                                      0
## [3,]      1     0     72                                     72
## [4,]      1     1    313                                    313
##      count.ovoQ6_droso_gr_unique
## [1,]                           0
## [2,]                       64212
## [3,]                           0
## [4,]                        1311
## attr(,"class")
## [1] "VennCounts"

## $p.value
##      SvbAct svbF7 pval
## [1,]      1     1  NaN
## 
## $vennCounts
##      SvbAct svbF7 Counts count.unique.SvbACT.peaks_assiociated.
## [1,]      0     0  -2574                                      0
## [2,]      0     1   2298                                      0
## [3,]      1     0    328                                    328
## [4,]      1     1     48                                     57
##      count.svbF7_cons_gr
## [1,]                   0
## [2,]                2298
## [3,]                   0
## [4,]                  56
## attr(,"class")
## [1] "VennCounts"

1.1.5 Dans les promotesurs des gènes cibles directes de Svb

## $p.value
##      SvbAct ovoQ6 svbF7 pval
## [1,]      0     1     1  NaN
## [2,]      1     0     1  NaN
## [3,]      1     1     0  NaN
## 
## $vennCounts
##      SvbAct ovoQ6 svbF7 Counts count.unique.promoters_directgenes_gr.
## [1,]      0     0     0 -52748                                      0
## [2,]      0     0     1    249                                      0
## [3,]      0     1     0  50336                                      0
## [4,]      0     1     1   2021                                      0
## [5,]      1     0     0     31                                     31
## [6,]      1     0     1      2                                      2
## [7,]      1     1     0    158                                    158
## [8,]      1     1     1     51                                     56
##      count.ovoQ6_droso_gr_unique count.svbF7_cons_gr
## [1,]                           0                   0
## [2,]                           0                 249
## [3,]                       50336                   0
## [4,]                       13587                2021
## [5,]                           0                   0
## [6,]                           0                   2
## [7,]                         921                   0
## [8,]                         679                  82
## attr(,"class")
## [1] "VennCounts"

## $p.value
##      SvbAct ovoQ6 pval
## [1,]      1     1  NaN
## 
## $vennCounts
##      SvbAct ovoQ6 Counts count.unique.promoters_directgenes_gr.
## [1,]      0     0 -64383                                      0
## [2,]      0     1  64236                                      0
## [3,]      1     0     33                                     33
## [4,]      1     1    214                                    214
##      count.ovoQ6_droso_gr_unique
## [1,]                           0
## [2,]                       64236
## [3,]                           0
## [4,]                        1287
## attr(,"class")
## [1] "VennCounts"

## $p.value
##      SvbAct svbF7 pval
## [1,]      1     1  NaN
## 
## $vennCounts
##      SvbAct svbF7 Counts count.unique.promoters_directgenes_gr.
## [1,]      0     0  -2463                                      0
## [2,]      0     1   2317                                      0
## [3,]      1     0    216                                    216
## [4,]      1     1     30                                     31
##      count.svbF7_cons_gr
## [1,]                   0
## [2,]                2317
## [3,]                   0
## [4,]                  37
## attr(,"class")
## [1] "VennCounts"

1.2 Enrichissement en histone des motifs SvbF7 fixé ou non

J’utilise la fonction de bedtools hypergéométrique avec comme option " a : les SvbF7 motif b : les marque d’histones et l’overlap est de 1bp

1.2.1 Stringent

1.2.1.1 H3K4me1

in H3K4me1 absent H3K4me1
in svbF7 unbound 578 811
absent svbF7 unbound 8188 5736
in H3K4me1 absent H3K4me1
in svbF7 bound 633 0
absent svbF7 bound 8139 6732
pvalue_fixe = phyper(633 - 1, 486, 15504 - 486, 8772)
pvalue_nonfixe = phyper(578 - 1, 1389, 15313 - 1389, 8766)
presence = c(633,8139)
absence = c(0,6732)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K4me1_fixe = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K4me1_fixe)

presence = c(578,8188)
absence = c(811,5736)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K4me1_nonfixe = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K4me1_nonfixe)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 4.409109110^{-35}

La pvalue du test de fisher pour les motifs fixé est de 1.024422510^{-161} Celle du test de fisher pour les motifs non fixé est de 1.413975810^{-34}`

total_svbF7_unbound = 578 + 811
total_svbF7_bound = 633

percent_svbf7_H3K4me1_unbound = round(100 * 578 / total_svbF7_unbound, 2 ) 
percent_svbf7_unbound_without_H3K4me1 = round(100 * 811 / total_svbF7_unbound, 2 ) 

percent_svbf7_H3K4me1_bound = round(100 * 633 / total_svbF7_bound, 2 ) 
percent_svbf7_bound_without_H3K4me1 = round(100 * 0 / total_svbF7_bound, 2 ) 


etat_svb = c("svbF7_bound","svbF7_unbound")
H3K4me1_absent = c(percent_svbf7_bound_without_H3K4me1,percent_svbf7_unbound_without_H3K4me1)

H3K4me1_present = c(percent_svbf7_H3K4me1_bound,percent_svbf7_H3K4me1_unbound)

data_H3K4me1 = data.frame(etat_svb,H3K4me1_absent,H3K4me1_present)
datatable(data_H3K4me1,rownames = F,filter = "none",colnames = c("Regions without H3K4me1","Regions with H3K4me1" ))
fig3 = plot_ly(data_H3K4me1, x = ~etat_svb,y = ~H3K4me1_absent, type = "bar",name = "H3K4me1 absent", color = I("grey"))
fig3 = fig3 %>% add_trace(y = ~H3K4me1_present, name = "H3K4me1 present", color = I("orange"))
fig3 = fig3 %>% layout(yaxis = list(title = "percent"))
fig3 = fig3 %>% layout(title = "H3K4me1 enrichment on svbF7 bound or not by Svb", barmode = "stack")
fig3

1.2.1.2 H3K4me3

in H3K4me3 absent H3K4me3
in svbF7 unbound 149 1240
absent svbF7 unbound 4658 10496
in H3K4me3 absent H3K4me3
in svbF7 bound 359 127
absent svbF7 bound 4449 11833
pvalue_fixe = phyper(633 - 1, 486, 15504 - 486, 8772)
pvalue_nonfixe = phyper(149 - 1, 1389, 16543 - 1389, 4807)
presence = c(359,4449)
absence = c(127,11833)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K4me3_fixe = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K4me3_fixe)

presence = c(149,4658)
absence = c(1240,10496)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K4me3_nonfixe = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K4me3_nonfixe)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 2.377300810^{-66}

La pvalue du test de fisher pour les motifs fixé est de 2.264480710^{-97} Celle du test de fisher pour les motifs non fixé est de 1.30972510^{-65}`

total_svbF7_unbound_H3K4me3 = 149 + 1240
total_svbF7_bound_H3K4me3 = 359 + 127

percent_svbf7_H3K4me3_unbound = round(100 * 149 / total_svbF7_unbound_H3K4me3, 2 ) 
percent_svbf7_unbound_without_H3K4me3 = round(100 * 1240 / total_svbF7_unbound_H3K4me3, 2 ) 

percent_svbf7_H3K4me3_bound = round(100 * 359 / total_svbF7_bound_H3K4me3, 2 ) 
percent_svbf7_bound_without_H3K4me3 = round(100 * 127 / total_svbF7_bound_H3K4me3, 2 ) 


etat_svb = c("svbF7_bound","svbF7_unbound")
H3K4me3_absent = c(percent_svbf7_bound_without_H3K4me3,percent_svbf7_unbound_without_H3K4me3)

H3K4me3_present = c(percent_svbf7_H3K4me3_bound,percent_svbf7_H3K4me3_unbound)

data_H3K4me3 = data.frame(etat_svb,H3K4me3_absent,H3K4me3_present)
datatable(data_H3K4me3,rownames = F,filter = "none",colnames = c("Regions without H3K4me3","Regions with H3K4me3" ))
fig4 = plot_ly(data_H3K4me3, x = ~etat_svb,y = ~H3K4me3_absent, type = "bar",name = "H3K4me3 absent", color = I("grey"))
fig4 = fig4 %>% add_trace(y = ~H3K4me3_present, name = "H3K4me3 present", color = I("pink"))
fig4 = fig4 %>% layout(yaxis = list(title = "percent"))
fig4 = fig4 %>% layout(title = "H3K4me3 enrichment on svbF7 bound or not by Svb", barmode = "stack")
fig4
1.2.1.2.1 Rapport K4me1/ K4me3
total_K4me1_S2 = 8782
total_K4me3_S2 = 4812
rapp_fixe = round((contingence_H3K4me1_fixe[1,1] / total_K4me1_S2 ) / (contingence_H3K4me3_fixe[1,1] / total_K4me3_S2),2)
rapp_nonfixe = round((contingence_H3K4me1_nonfixe[1,1] / total_K4me1_S2)  / (contingence_H3K4me3_nonfixe[1,1] / total_K4me3_S2) ,2)

Il y a 0.97 fois de H3K4me1 que de H3K4me3 fixé.

Il y a 2.13 fois de H3K4me1 que de H3K4me3 non fixé.

1.2.1.3 H3K27ac

in H3K27ac absent H3K27ac
in svbF7 unbound 286 1103
absent svbF7 unbound 4862 7327
in H3K27ac absent H3K27ac
in svbF7 bound 435 51
absent svbF7 bound 4718 8527
pvalue_fixe = phyper(435 - 1, 486, 13731 - 486, 5153)
pvalue_nonfixe = phyper(286 - 1, 1389, 13578 - 1389, 5148)
presence = c(435,4718)
absence = c(51,8527)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K27ac_fixe = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K27ac_fixe)

presence = c(286,4862)
absence = c(1103,7327)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K27ac_nonfixe = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K27ac_nonfixe)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 6.787045710^{-49}

La pvalue du test de fisher pour les motifs fixé est de 4.16793910^{-131} Celle du test de fisher pour les motifs non fixé est de 2.604877810^{-48}`

total_svbF7_unbound_H3K27ac = 286 + 1103
total_svbF7_bound_H3K27ac = 435 + 51

percent_svbf7_H3K27ac_unbound = round(100 * 286 / total_svbF7_unbound_H3K27ac, 2 ) 
percent_svbf7_unbound_without_H3K27ac = round(100 * 1103 / total_svbF7_unbound_H3K27ac, 2 ) 

percent_svbf7_H3K27ac_bound = round(100 * 435 / total_svbF7_bound_H3K27ac, 2 ) 
percent_svbf7_bound_without_H3K27ac = round(100 * 51 / total_svbF7_bound_H3K27ac, 2 ) 


etat_svb = c("svbF7_bound","svb_unbound")
H3K27ac_absent = c(percent_svbf7_bound_without_H3K27ac,percent_svbf7_unbound_without_H3K27ac)

H3K27ac_present = c(percent_svbf7_H3K27ac_bound,percent_svbf7_H3K27ac_unbound)

data_H3K27ac = data.frame(etat_svb,H3K27ac_absent,H3K27ac_present)
datatable(data_H3K27ac,rownames = F,filter = "none",colnames = c("Regions without H3K27ac","Regions with H3K27ac" ))
fig1 = plot_ly(data_H3K27ac, x = ~etat_svb,y = ~H3K27ac_absent, type = "bar",name = "H3K27ac absent", color = I("grey"))
fig1 = fig1 %>% add_trace(y = ~H3K27ac_present, name = "H3K27ac present", color = I("blue"))
fig1 = fig1 %>% layout(yaxis = list(title = "percent"))
fig1 = fig1 %>% layout(title = "H3K27ac enrichment on svbF7 bound or not by Svb")
fig1
fig1 = plot_ly(data_H3K27ac, x = ~etat_svb,y = ~H3K27ac_absent, type = "bar",name = "H3K27ac absent", color = I("grey"))
fig1 = fig1 %>% add_trace(y = ~H3K27ac_present, name = "H3K27ac present", color = I("blue"))
fig1 = fig1 %>% layout(yaxis = list(title = "percent"))
fig1 = fig1 %>% layout(title = "H3K27ac enrichment on svbF7 bound or not by Svb", barmode = "stack")
fig1

1.2.1.4 H3K27me3

in H3K27me3 absent H3K27me3
in svbF7 unbound 1868 0
absent svbF7 unbound 11567 4071
in H3K27me3 absent H3K27me3
in svbF7 bound 311 175
absent svbF7 bound 13127 4145
pvalue_fixe = phyper(311 - 1, 486, 17758 - 486, 13438)
pvalue_nonfixe = phyper(286 - 1, 1389, 13578 - 1389, 5148)
presence = c(311,13127)
absence = c(175,4145)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K27me3_fixe = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K27me3_fixe)

presence = c(1868,11567)
absence = c(0,4071)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K27me3_nonfixe = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K27me3_nonfixe)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1.97262510^{-9} Celle du test de hypergéométrique pour les motifs non fixé est de 6.787045710^{-49}

La pvalue du test de fisher pour les motifs fixé est de 5.596902110^{-9} Celle du test de fisher pour les motifs non fixé est de 2.022617710^{-229}`

total_svbF7_unbound_H3K27me3 = 1868 + 0
total_svbF7_bound_H3K27me3 = 311 + 175

percent_svbf7_H3K27me3_unbound = round(100 * 1868 / total_svbF7_unbound_H3K27me3, 2 ) 
percent_svbf7_unbound_without_H3K27me3 = round(100 * 0 / total_svbF7_unbound_H3K27me3, 2 ) 

percent_svbf7_H3K27me3_bound = round(100 * 311 / total_svbF7_bound_H3K27me3, 2 ) 
percent_svbf7_bound_without_H3K27me3 = round(100 * 175 / total_svbF7_bound_H3K27me3, 2 ) 


etat_svb = c("svbF7_bound","svbF7_unbound")
H3K27me3_absent = c(percent_svbf7_bound_without_H3K27me3,percent_svbf7_unbound_without_H3K27me3)

H3K27me3_present = c(percent_svbf7_H3K27me3_bound,percent_svbf7_H3K27me3_unbound)

data_H3K27me3 = data.frame(etat_svb,H3K27me3_absent,H3K27me3_present)
datatable(data_H3K27me3,rownames = F,filter = "none",colnames = c("Regions without H3K27me3","Regions with H3K27me3" ))
fig2 = plot_ly(data_H3K27me3, x = ~etat_svb,y = ~H3K27me3_absent, type = "bar",name = "H3K27me3 absent", color = I("grey"))
fig2 = fig2 %>% add_trace(y = ~H3K27me3_present, name = "H3K27me3 present", color = I("purple"))
fig2 = fig2 %>% layout(yaxis = list(title = "percent"))
fig2 = fig2 %>% layout(title = "H3K27me3 enrichment on svbF7 bound or not by Svb", barmode = "stack")
fig2

1.2.2 Sensible

1.2.2.1 H3K4me1

in H3K4me1 absent H3K4me1
in svbF7 unbound 514 813
absent svbF7 unbound 8252 5729
in H3K4me1 absent H3K4me1
in svbF7 bound 698 0
absent svbF7 bound 8074 6722
pvalue_fixe = phyper(698 - 1, 549, 15494 - 549, 8772)
pvalue_nonfixe = phyper(514 - 1, 1327, 15308 - 1327, 8766)
presence = c(698,8074)
absence = c(0,6722)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K4me1_fixe = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K4me1_fixe)

presence = c(514,8252)
absence = c(813,5729)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K4me1_nonfixe = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K4me1_nonfixe)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 3.231743410^{-46}

La pvalue du test de fisher pour les motifs fixé est de 1.39957510^{-178} Celle du test de fisher pour les motifs non fixé est de 1.266940710^{-45}`

total_svbF7_unbound = 514 + 813
total_svbF7_bound = 698

percent_svbf7_H3K4me1_unbound = round(100 * 514 / total_svbF7_unbound, 2 ) 
percent_svbf7_unbound_without_H3K4me1 = round(100 * 813 / total_svbF7_unbound, 2 ) 

percent_svbf7_H3K4me1_bound = round(100 * 698 / total_svbF7_bound, 2 ) 
percent_svbf7_bound_without_H3K4me1 = round(100 * 0 / total_svbF7_bound, 2 ) 



etat_svb = c("svbF7_bound","svbF7_unbound")
H3K4me1_absent = c(percent_svbf7_bound_without_H3K4me1,percent_svbf7_unbound_without_H3K4me1)

H3K4me1_present = c(percent_svbf7_H3K4me1_bound,percent_svbf7_H3K4me1_unbound)

data_H3K4me1 = data.frame(etat_svb,H3K4me1_absent,H3K4me1_present)
datatable(data_H3K4me1,rownames = F,filter = "none", colnames = c("Regions without H3K4me1","Regions with H3K4me1" ))
fig3 = plot_ly(data_H3K4me1, x = ~etat_svb,y = ~H3K4me1_present, type = "bar",name = "H3K4me1 present", color = I("orange"))
fig3 = fig3 %>% add_trace(y = ~H3K4me1_absent, name = "H3K4me1 absent", color = I("grey"))
fig3 = fig3 %>% layout(yaxis = list(title = "percent"))
fig3 = fig3 %>% layout(title = "H3K4me1 enrichment on svbF7 bound or not by Svb", barmode = "stack")
fig3
data_H3K4me1 = data.frame(etat_svb,H3K4me1_absent,H3K4me1_present)
datatable(data_H3K4me1,rownames = F,filter = "none", colnames = c("Regions without H3K4me1","Regions with H3K4me1" ))
fig3 = plot_ly(data_H3K4me1, x = ~etat_svb,y = ~H3K4me1_present, type = "bar",name = "H3K4me1 present", color = I("orange"))
fig3 = fig3 %>% add_trace(y = ~H3K4me1_absent, name = "H3K4me1 absent", color = I("grey"))
fig3 = fig3 %>% layout(yaxis = list(title = "percent"))
fig3 = fig3 %>% layout(title = "H3K4me1 enrichment on svbF7 bound or not by Svb")
fig3

1.2.2.2 H3K4me3

in H3K4me3 absent H3K4me3
in svbF7 unbound 121 1206
absent svbF7 unbound 4686 10524
in H3K4me3 absent H3K4me3
in svbF7 bound 388 161
absent svbF7 bound 4420 11787
pvalue_fixe = phyper(388 - 1, 549, 16756 - 549, 4808)
pvalue_nonfixe = phyper(121 - 1, 1327, 16537 - 1327, 4807)
presence = c(388,4420)
absence = c(161,11787)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K4me3_fixe = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K4me3_fixe)

presence = c(121,4686)
absence = c(1206,10524)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K4me3_nonfixe = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K4me3_nonfixe)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 2.348151110^{-76}

La pvalue du test de fisher pour les motifs fixé est de 2.414317810^{-95} Celle du test de fisher pour les motifs non fixé est de 1.779050610^{-75}`

total_svbF7_unbound_H3K4me3 = 121 + 1206
total_svbF7_bound_H3K4me3 = 388 + 161

percent_svbf7_H3K4me3_unbound = round(100 * 121 / total_svbF7_unbound_H3K4me3, 2 ) 
percent_svbf7_unbound_without_H3K4me3 = round(100 * 1206 / total_svbF7_unbound_H3K4me3, 2 ) 

percent_svbf7_H3K4me3_bound = round(100 * 388 / total_svbF7_bound_H3K4me3, 2 ) 
percent_svbf7_bound_without_H3K4me3 = round(100 * 161 / total_svbF7_bound_H3K4me3, 2 ) 



etat_svb = c("svbF7_bound","svbF7_unbound")
H3K4me3_absent = c(percent_svbf7_bound_without_H3K4me3,percent_svbf7_unbound_without_H3K4me3)

H3K4me3_present = c(percent_svbf7_H3K4me3_bound,percent_svbf7_H3K4me3_unbound)

data_H3K4me3 = data.frame(etat_svb,H3K4me3_absent,H3K4me3_present)
datatable(data_H3K4me3,rownames = F,filter = "none",colnames = c("Regions without H3K4me3","Regions with H3K4me3" ))
fig4 = plot_ly(data_H3K4me3, x = ~etat_svb,y = ~H3K4me3_present, type = "bar",name = "H3K4me3 present", color = I("pink"))
fig4 = fig4 %>% add_trace(y = ~H3K4me3_absent, name = "H3K4me3 absent", color = I("grey"))
fig4 = fig4 %>% layout(yaxis = list(title = "percent"))
fig4 = fig4 %>% layout(title = "H3K4me3 enrichment on svbF7 bound or not by Svb", barmode = "stack")
fig4
fig4 = plot_ly(data_H3K4me3, x = ~etat_svb,y = ~H3K4me3_present, type = "bar",name = "H3K4me3 present", color = I("pink"))
fig4 = fig4 %>% add_trace(y = ~H3K4me3_absent, name = "H3K4me3 absent", color = I("grey"))
fig4 = fig4 %>% layout(yaxis = list(title = "percent"))
fig4 = fig4 %>% layout(title = "H3K4me3 enrichment on svbF7 bound or not by Svb")
fig4
1.2.2.2.1 Rapport K4me1/ K4me3
total_K4me1_S2 = 8782
total_K4me3_S2 = 4812
rapp_fixe = round((contingence_H3K4me1_fixe[1,1] / total_K4me1_S2 ) / (contingence_H3K4me3_fixe[1,1] / total_K4me3_S2),2)
rapp_nonfixe = round((contingence_H3K4me1_nonfixe[1,1] / total_K4me1_S2)  / (contingence_H3K4me3_nonfixe[1,1] / total_K4me3_S2) ,2)

Il y a 0.99 fois de H3K4me1 que de H3K4me3 fixé.

Il y a 2.33 fois de H3K4me1 que de H3K4me3 non fixé.

1.2.2.3 H3K27ac

in H3K27ac absent H3K27ac
in svbF7 unbound 244 1083
absent svbF7 unbound 4904 7343
in H3K27ac absent H3K27ac
in svbF7 bound 478 71
absent svbF7 bound 4675 8500
pvalue_fixe = phyper(478 - 1, 549, 13724 - 549, 5153)
pvalue_nonfixe = phyper(244 - 1, 1327, 13574 - 1327, 5148)
presence = c(478,4675)
absence = c(71,8500)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K27ac_fixe = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K27ac_fixe)

presence = c(244,4904)
absence = c(1083,7343)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K27ac_nonfixe = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K27ac_nonfixe)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 1.425593210^{-59}

La pvalue du test de fisher pour les motifs fixé est de 2.973567510^{-133} Celle du test de fisher pour les motifs non fixé est de 8.220511410^{-59}`

total_svbF7_unbound_H3K27ac = 244 + 1083
total_svbF7_bound_H3K27ac = 478 + 71

percent_svbf7_H3K27ac_unbound = round(100 * 244 / total_svbF7_unbound_H3K27ac, 2 ) 
percent_svbf7_unbound_without_H3K27ac = round(100 * 1083 / total_svbF7_unbound_H3K27ac, 2 ) 

percent_svbf7_H3K27ac_bound = round(100 * 478 / total_svbF7_bound_H3K27ac, 2 ) 
percent_svbf7_bound_without_H3K27ac = round(100 * 71 / total_svbF7_bound_H3K27ac, 2 ) 


etat_svb = c("svbF7_bound","svb_unbound")
H3K27ac_absent = c(percent_svbf7_bound_without_H3K27ac,percent_svbf7_unbound_without_H3K27ac)

H3K27ac_present = c(percent_svbf7_H3K27ac_bound,percent_svbf7_H3K27ac_unbound)

data_H3K27ac = data.frame(etat_svb,H3K27ac_absent,H3K27ac_present)
datatable(data_H3K27ac,rownames = F,filter = "none",colnames = c("Regions without H3K27ac","Regions with H3K27ac" ))
# fig1 = plot_ly(data_H3K27ac, x = ~etat_svb,y = ~H3K27ac_absent, type = "bar",name = "H3K27ac absent")
# fig1 = fig1 %>% add_trace(y = ~H3K27ac_present, name = "H3K27ac present")
# fig1 = fig1 %>% layout(yaxis = list(title = "percent"))
# fig1 = fig1 %>% layout(title = "H3K27ac enrichment on svbF7 bound or not by Svb")
# fig1

fig1 = plot_ly(data_H3K27ac, x = ~etat_svb,y = ~H3K27ac_present, type = "bar",name = "H3K27ac present", color = I("blue"))
fig1 = fig1 %>% add_trace(y = ~H3K27ac_absent, name = "H3K27ac absent", color = I("grey"))
fig1 = fig1 %>% layout(yaxis = list(title = "percent"))
fig1 = fig1 %>% layout(title = "H3K27ac enrichment on svbF7 bound or not by Svb", barmode = "stack")
fig1
fig1 = plot_ly(data_H3K27ac, x = ~etat_svb,y = ~H3K27ac_present, type = "bar",name = "H3K27ac present", color = I("blue"))
fig1 = fig1 %>% add_trace(y = ~H3K27ac_absent, name = "H3K27ac absent", color = I("grey"))
fig1 = fig1 %>% layout(yaxis = list(title = "percent"))
fig1 = fig1 %>% layout(title = "H3K27ac enrichment on svbF7 bound or not by Svb")
fig1

1.2.2.4 H3K27me3

in H3K27me3 absent H3K27me3
in svbF7 unbound 1791 0
absent svbF7 unbound 11644 4065
in H3K27me3 absent H3K27me3
in svbF7 bound 392 71
absent svbF7 bound 13046 4151
pvalue_fixe = phyper(392 - 1, 549, 17746 - 549, 13438)
pvalue_nonfixe = phyper(1791 - 1, 1327, 17500 - 1327, 13435)
presence = c(392,13046)
absence = c(71,4151)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K27me3_fixe = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K27me3_fixe)

presence = c(1791,11644)
absence = c(0,4065)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K27me3_nonfixe = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K27me3_nonfixe)

La pvalue du test de hypergéométrique pour les motifs fixé est de 0.0079173 Celle du test de hypergéométrique pour les motifs non fixé est de 1

La pvalue du test de fisher pour les motifs fixé est de 5.493538610^{-6} Celle du test de fisher pour les motifs non fixé est de 4.53427810^{-219}`

total_svbF7_unbound_H3K27me3 = 1791 + 0
total_svbF7_bound_H3K27me3 = 392 + 157

percent_svbf7_H3K27me3_unbound = round(100 * 1791 / total_svbF7_unbound_H3K27me3, 2 ) 
percent_svbf7_unbound_without_H3K27me3 = round(100 * 0 / total_svbF7_unbound_H3K27me3, 2 ) 

percent_svbf7_H3K27me3_bound = round(100 * 392 / total_svbF7_bound_H3K27me3, 2 ) 
percent_svbf7_bound_without_H3K27me3 = round(100 * 157 / total_svbF7_bound_H3K27me3, 2 ) 


etat_svb = c("svbF7_bound","svbF7_unbound")
H3K27me3_absent = c(percent_svbf7_bound_without_H3K27me3,percent_svbf7_unbound_without_H3K27me3)

H3K27me3_present = c(percent_svbf7_H3K27me3_bound,percent_svbf7_H3K27me3_unbound)

data_H3K27me3 = data.frame(etat_svb,H3K27me3_absent,H3K27me3_present)
datatable(data_H3K27me3,rownames = F,filter = "none",colnames = c("Regions without H3K27me3","Regions with H3K27me3" ))
fig2 = plot_ly(data_H3K27me3, x = ~etat_svb,y = ~H3K27me3_present, type = "bar",name = "H3K27me3 present", color =I("purple"))
fig2 = fig2 %>% add_trace(y = ~H3K27me3_absent, name = "H3K27me3 absent",color = I("grey"))
fig2 = fig2 %>% layout(yaxis = list(title = "percent"))
fig2 = fig2 %>% layout(title = "H3K27me3 enrichment on svbF7 bound or not by Svb", barmode = "stack")
fig2
fig2 = plot_ly(data_H3K27me3, x = ~etat_svb,y = ~H3K27me3_present, type = "bar",name = "H3K27me3 present", color =I("purple"))
fig2 = fig2 %>% add_trace(y = ~H3K27me3_absent, name = "H3K27me3 absent",color = I("grey"))
fig2 = fig2 %>% layout(yaxis = list(title = "percent"))
fig2 = fig2 %>% layout(title = "H3K27me3 enrichment on svbF7 bound or not by Svb")
fig2

1.2.3 Histones en présence de Svb

Je regarde ici l’enrichisement en histones des motifs de Svb en présence des différentes formes de Svb ( Act/ Rep) et Ctrl

1.2.3.1 H3K4me1

1.2.3.1.1 Ctrl
in H3K4me1 absent H3K4me1
in svbF7 unbound 818 571
absent svbF7 unbound 9368 4332
in H3K4me1 absent H3K4me1
in svbF7 bound 698 0
absent svbF7 bound 9498 5082
pvalue_fixe = phyper(698 - 1, 486, 15278 - 486, 10196)
pvalue_nonfixe = phyper(818 - 1, 1389, 15089 - 1389, 10186)
presence = c(698,0)
absence = c(9498,5082)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K4me1_fixe_ctrl = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K4me1_fixe_ctrl)

presence = c(818,9368)
absence = c(571,4332)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K4me1_nonfixe_ctrl = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K4me1_nonfixe_ctrl)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 6.137004310^{-13}

La pvalue du test de fisher pour les motifs fixé est de 1.112238610^{-126} Celle du test de fisher pour les motifs non fixé est de 1.73553510^{-12}`

total_svbF7_unbound = 818 + 571
total_svbF7_bound = 698 + 0

percent_svbf7_H3K4me1_unbound = round(100 * 818 / total_svbF7_unbound, 2 ) 
percent_svbf7_unbound_without_H3K4me1 = round(100 * 571 / total_svbF7_unbound, 2 ) 

percent_svbf7_H3K4me1_bound = round(100 * 698 / total_svbF7_bound, 2 ) 
percent_svbf7_bound_without_H3K4me1 = round(100 * 0 / total_svbF7_bound, 2 ) 



etat_svb = c("svbF7_bound","svbF7_unbound")
H3K4me1_absent = c(percent_svbf7_bound_without_H3K4me1,percent_svbf7_unbound_without_H3K4me1)

H3K4me1_present = c(percent_svbf7_H3K4me1_bound,percent_svbf7_H3K4me1_unbound)

data_H3K4me1_ctrl = data.frame(etat_svb,H3K4me1_absent,H3K4me1_present)
datatable(data_H3K4me1_ctrl,rownames = F,filter = "none", colnames = c("Regions without H3K4me1","Regions with H3K4me1" ))
fig3 = plot_ly(data_H3K4me1_ctrl, x = ~etat_svb,y = ~H3K4me1_present, type = "bar",name = "H3K4me1 present", color = I("orange"))
fig3 = fig3 %>% add_trace(y = ~H3K4me1_absent, name = "H3K4me1 absent", color = I("grey"))
fig3 = fig3 %>% layout(yaxis = list(title = "percent"))
fig3 = fig3 %>% layout(title = "H3K4me1 enrichment on svbF7 bound or not by Svb (Ctrl condition)", barmode = "stack")
fig3
fig3 = plot_ly(data_H3K4me1_ctrl, x = ~etat_svb,y = ~H3K4me1_present, type = "bar",name = "H3K4me1 present", color = I("orange"))
fig3 = fig3 %>% add_trace(y = ~H3K4me1_absent, name = "H3K4me1 absent", color = I("grey"))
fig3 = fig3 %>% layout(yaxis = list(title = "percent"))
fig3 = fig3 %>% layout(title = "H3K4me1 enrichment on svbF7 bound or not by Svb (Ctrl condition)")
fig3
1.2.3.1.2 Act
in H3K4me1 absent H3K4me1
in svbF7 unbound 988 401
absent svbF7 unbound 11249 0
in H3K4me1 absent H3K4me1
in svbF7 bound 753 0
absent svbF7 bound 11497 3863
pvalue_fixe = phyper(753 - 1, 486, 16113 - 486, 12250)
pvalue_nonfixe = phyper(988 - 1, 1389, 15904 - 1389, 12237)
presence = c(753,11497)
absence = c(0,3863)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K4me1_fixe_act = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K4me1_fixe_act)

presence = c(988,11249)
absence = c(0,401)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K4me1_nonfixe_act = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K4me1_nonfixe_act)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 6.005383710^{-8}

La pvalue du test de fisher pour les motifs fixé est de 1.450122910^{-92} Celle du test de fisher pour les motifs non fixé est de 6.41756610^{-15}`

total_svbF7_unbound = 988 + 401
total_svbF7_bound = 753 + 0

percent_svbf7_H3K4me1_unbound = round(100 * 988 / total_svbF7_unbound, 2 ) 
percent_svbf7_unbound_without_H3K4me1 = round(100 * 401 / total_svbF7_unbound, 2 ) 

percent_svbf7_H3K4me1_bound = round(100 * 753 / total_svbF7_bound, 2 ) 
percent_svbf7_bound_without_H3K4me1 = round(100 * 0 / total_svbF7_bound, 2 ) 



etat_svb = c("svbF7_bound","svbF7_unbound")
H3K4me1_absent = c(percent_svbf7_bound_without_H3K4me1,percent_svbf7_unbound_without_H3K4me1)

H3K4me1_present = c(percent_svbf7_H3K4me1_bound,percent_svbf7_H3K4me1_unbound)

data_H3K4me1_act = data.frame(etat_svb,H3K4me1_absent,H3K4me1_present)
datatable(data_H3K4me1_act,rownames = F,filter = "none", colnames = c("Regions without H3K4me1","Regions with H3K4me1" ))
fig3 = plot_ly(data_H3K4me1_act, x = ~etat_svb,y = ~H3K4me1_present, type = "bar",name = "H3K4me1 present", color = I("orange"))
fig3 = fig3 %>% add_trace(y = ~H3K4me1_absent, name = "H3K4me1 absent", color = I("grey"))
fig3 = fig3 %>% layout(yaxis = list(title = "percent"))
fig3 = fig3 %>% layout(title = "H3K4me1 enrichment on svbF7 bound or not by Svb (Act condition)", barmode = "stack")
fig3
fig3 = plot_ly(data_H3K4me1_act, x = ~etat_svb,y = ~H3K4me1_present, type = "bar",name = "H3K4me1 present", color = I("orange"))
fig3 = fig3 %>% add_trace(y = ~H3K4me1_absent, name = "H3K4me1 absent", color = I("grey"))
fig3 = fig3 %>% layout(yaxis = list(title = "percent"))
fig3 = fig3 %>% layout(title = "H3K4me1 enrichment on svbF7 bound or not by Svb (Act condition)")
fig3
1.2.3.1.3 Rep
in H3K4me1 absent H3K4me1
in svbF7 unbound 920 469
absent svbF7 unbound 10874 3453
in H3K4me1 absent H3K4me1
in svbF7 bound 745 0
absent svbF7 bound 11057 4118
pvalue_fixe = phyper(745 - 1, 486, 15920 - 486, 11802)
pvalue_nonfixe = phyper(920 - 1, 1389, 17166 - 1389, 11794)
presence = c(745,11057)
absence = c(0,4118)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K4me1_fixe_rep = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K4me1_fixe_rep)

presence = c(920,10874)
absence = c(469,3453)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K4me1_nonfixe_rep = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K4me1_nonfixe_rep)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 0.0182405

La pvalue du test de fisher pour les motifs fixé est de 3.317013410^{-100} Celle du test de fisher pour les motifs non fixé est de 1.431330110^{-14}`

total_svbF7_unbound = 920 + 469
total_svbF7_bound = 745 + 0

percent_svbf7_H3K4me1_unbound = round(100 * 920 / total_svbF7_unbound, 2 ) 
percent_svbf7_unbound_without_H3K4me1 = round(100 * 469 / total_svbF7_unbound, 2 ) 

percent_svbf7_H3K4me1_bound = round(100 * 746 / total_svbF7_bound, 2 ) 
percent_svbf7_bound_without_H3K4me1 = round(100 * 0 / total_svbF7_bound, 2 ) 



etat_svb = c("svbF7_bound","svbF7_unbound")
H3K4me1_absent = c(percent_svbf7_bound_without_H3K4me1,percent_svbf7_unbound_without_H3K4me1)

H3K4me1_present = c(percent_svbf7_H3K4me1_bound,percent_svbf7_H3K4me1_unbound)

data_H3K4me1_rep = data.frame(etat_svb,H3K4me1_absent,H3K4me1_present)
datatable(data_H3K4me1_rep,rownames = F,filter = "none", colnames = c("Regions without H3K4me1","Regions with H3K4me1" ))
fig3 = plot_ly(data_H3K4me1_rep, x = ~etat_svb,y = ~H3K4me1_present, type = "bar",name = "H3K4me1 present", color = I("orange"))
fig3 = fig3 %>% add_trace(y = ~H3K4me1_absent, name = "H3K4me1 absent", color = I("grey"))
fig3 = fig3 %>% layout(yaxis = list(title = "percent"))
fig3 = fig3 %>% layout(title = "H3K4me1 enrichment on svbF7 bound or not by Svb (Rep condition)", barmode = "stack")
fig3
fig3 = plot_ly(data_H3K4me1_rep, x = ~etat_svb,y = ~H3K4me1_present, type = "bar",name = "H3K4me1 present", color = I("orange"))
fig3 = fig3 %>% add_trace(y = ~H3K4me1_absent, name = "H3K4me1 absent", color = I("grey"))
fig3 = fig3 %>% layout(yaxis = list(title = "percent"))
fig3 = fig3 %>% layout(title = "H3K4me1 enrichment on svbF7 bound or not by Svb (Rep condition)")
fig3

1.2.3.2 H3K4me3

1.2.3.2.1 Ctrl
in H3K4me3 absent H3K4me3
in svbF7 unbound 721 668
absent svbF7 unbound 9924 6743
in H3K4me3 absent H3K4me3
in svbF7 bound 405 81
absent svbF7 bound 10240 7598
pvalue_fixe = phyper(405 - 1, 486, 18324 - 486, 10645)
pvalue_nonfixe = phyper(721 - 1, 1389, 18025 - 1389, 10645)
presence = c(405,81)
absence = c(10240,7598)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K4me3_fixe_ctrl = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K4me3_fixe_ctrl)

presence = c(721,9924)
absence = c(668,6743)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K4me3_nonfixe_ctrl = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K4me3_nonfixe_ctrl)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 8.857963910^{-9}

La pvalue du test de fisher pour les motifs fixé est de 2.206021510^{-33} Celle du test de fisher pour les motifs non fixé est de 3.492107710^{-8}`

total_svbF7_unbound_H3K4me3 = 721 + 668
total_svbF7_bound_H3K4me3 = 405 + 81

percent_svbf7_H3K4me3_unbound = round(100 * 721 / total_svbF7_unbound_H3K4me3, 2 ) 
percent_svbf7_unbound_without_H3K4me3 = round(100 * 668 / total_svbF7_unbound_H3K4me3, 2 ) 

percent_svbf7_H3K4me3_bound = round(100 * 405 / total_svbF7_bound_H3K4me3, 2 ) 
percent_svbf7_bound_without_H3K4me3 = round(100 * 81 / total_svbF7_bound_H3K4me3, 2 ) 



etat_svb = c("svbF7_bound","svbF7_unbound")
H3K4me3_absent = c(percent_svbf7_bound_without_H3K4me3,percent_svbf7_unbound_without_H3K4me3)

H3K4me3_present = c(percent_svbf7_H3K4me3_bound,percent_svbf7_H3K4me3_unbound)

data_H3K4me3_ctrl = data.frame(etat_svb,H3K4me3_absent,H3K4me3_present)
datatable(data_H3K4me3_ctrl,rownames = F,filter = "none",colnames = c("Regions without H3K4me3","Regions with H3K4me3" ))
fig4 = plot_ly(data_H3K4me3_ctrl, x = ~etat_svb,y = ~H3K4me3_absent, type = "bar",name = "H3K4me3 absent", color = I("grey"))
fig4 = fig4 %>% add_trace(y = ~H3K4me3_present, name = "H3K4me3 present", color = I("pink"))
fig4 = fig4 %>% layout(yaxis = list(title = "percent"))
fig4 = fig4 %>% layout(title = "H3K4me3 enrichment on svbF7 bound or not by Svb (Ctrl condition)", barmode = "stack")
fig4
in H3K4me3 absent H3K4me3
in svbF7 unbound 343 1046
absent svbF7 unbound 6896 9899
in H3K4me3 absent H3K4me3
in svbF7 bound 334 152
absent svbF7 bound 6906 11030
pvalue_fixe = phyper(334 - 1, 486, 18422 - 486, 7240)
pvalue_nonfixe = phyper(343 - 1, 1389, 18151 - 1389, 7239)
presence = c(334,6906)
absence = c(152,11030)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K4me3_fixe_act = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K4me3_fixe_act)

presence = c(343,6896)
absence = c(1046,9899)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K4me3_nonfixe_act = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K4me3_nonfixe_act)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 1.091793410^{-35}

La pvalue du test de fisher pour les motifs fixé est de 4.034298210^{-40} Celle du test de fisher pour les motifs non fixé est de 8.501713810^{-35}`

total_svbF7_unbound_H3K4me3 = 343 + 1046
total_svbF7_bound_H3K4me3 = 334 + 152

percent_svbf7_H3K4me3_unbound = round(100 * 343 / total_svbF7_unbound_H3K4me3, 2 ) 
percent_svbf7_unbound_without_H3K4me3 = round(100 * 1046 / total_svbF7_unbound_H3K4me3, 2 ) 

percent_svbf7_H3K4me3_bound = round(100 * 334 / total_svbF7_bound_H3K4me3, 2 ) 
percent_svbf7_bound_without_H3K4me3 = round(100 * 152 / total_svbF7_bound_H3K4me3, 2 ) 



etat_svb = c("svbF7_bound","svbF7_unbound")
H3K4me3_absent = c(percent_svbf7_bound_without_H3K4me3,percent_svbf7_unbound_without_H3K4me3)

H3K4me3_present = c(percent_svbf7_H3K4me3_bound,percent_svbf7_H3K4me3_unbound)

data_H3K4me3_act = data.frame(etat_svb,H3K4me3_absent,H3K4me3_present)
datatable(data_H3K4me3_act,rownames = F,filter = "none",colnames = c("Regions without H3K4me3","Regions with H3K4me3" ))
fig4 = plot_ly(data_H3K4me3_act, x = ~etat_svb,y = ~H3K4me3_present, type = "bar",name = "H3K4me3 present", color = I("pink"))
fig4 = fig4 %>% add_trace(y = ~H3K4me3_absent, name = "H3K4me3 absent", color = I("grey"))
fig4 = fig4 %>% layout(yaxis = list(title = "percent"))
fig4 = fig4 %>% layout(title = "H3K4me3 enrichment on svbF7 bound or not by Svb (Act condition)", barmode = "stack")
fig4
fig4 = plot_ly(data_H3K4me3_act, x = ~etat_svb,y = ~H3K4me3_present, type = "bar",name = "H3K4me3 present", color = I("pink"))
fig4 = fig4 %>% add_trace(y = ~H3K4me3_absent, name = "H3K4me3 absent", color = I("grey"))
fig4 = fig4 %>% layout(yaxis = list(title = "percent"))
fig4 = fig4 %>% layout(title = "H3K4me3 enrichment on svbF7 bound or not by Svb (Act condition)")
fig4
1.2.3.2.2 Rep
in H3K4me3 absent H3K4me3
in svbF7 unbound 146 1243
absent svbF7 unbound 4548 10940
in H3K4me3 absent H3K4me3
in svbF7 bound 328 158
absent svbF7 bound 4467 12262
pvalue_fixe = phyper(328 - 1, 486, 17215 - 486, 4795)
pvalue_nonfixe = phyper(328 - 1, 1389, 18685 - 1389, 11861)
presence = c(328,4467)
absence = c(158,12262)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K4me3_fixe_rep = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K4me3_fixe_rep)

presence = c(328,4467)
absence = c(158,12262)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K4me3_nonfixe_rep = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K4me3_nonfixe_rep)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 5.097738610^{-219}

La pvalue du test de fisher pour les motifs fixé est de 7.836987810^{-76} Celle du test de fisher pour les motifs non fixé est de 7.836987810^{-76}`

total_svbF7_unbound_H3K4me3 = 146 + 1243
total_svbF7_bound_H3K4me3 = 328 + 158

percent_svbf7_H3K4me3_unbound = round(100 * 146 / total_svbF7_unbound_H3K4me3, 2 ) 
percent_svbf7_unbound_without_H3K4me3 = round(100 * 1243 / total_svbF7_unbound_H3K4me3, 2 ) 

percent_svbf7_H3K4me3_bound = round(100 * 328 / total_svbF7_bound_H3K4me3, 2 ) 
percent_svbf7_bound_without_H3K4me3 = round(100 * 158 / total_svbF7_bound_H3K4me3, 2 ) 



etat_svb = c("svbF7_bound","svbF7_unbound")
H3K4me3_absent = c(percent_svbf7_bound_without_H3K4me3,percent_svbf7_unbound_without_H3K4me3)

H3K4me3_present = c(percent_svbf7_H3K4me3_bound,percent_svbf7_H3K4me3_unbound)

data_H3K4me3_rep = data.frame(etat_svb,H3K4me3_absent,H3K4me3_present)
datatable(data_H3K4me3_rep,rownames = F,filter = "none",colnames = c("Regions without H3K4me3","Regions with H3K4me3" ))
fig4 = plot_ly(data_H3K4me3_rep, x = ~etat_svb,y = ~H3K4me3_present, type = "bar",name = "H3K4me3 present", color = I("pink"))
fig4 = fig4 %>% add_trace(y = ~H3K4me3_absent, name = "H3K4me3 absent", color = I("grey"))
fig4 = fig4 %>% layout(yaxis = list(title = "percent"))
fig4 = fig4 %>% layout(title = "H3K4me3 enrichment on svbF7 bound or not by Svb (Rep condition)", barmode = "stack")
fig4
fig4 = plot_ly(data_H3K4me3_rep, x = ~etat_svb,y = ~H3K4me3_present, type = "bar",name = "H3K4me3 present", color = I("pink"))
fig4 = fig4 %>% add_trace(y = ~H3K4me3_absent, name = "H3K4me3 absent", color = I("grey"))
fig4 = fig4 %>% layout(yaxis = list(title = "percent"))
fig4 = fig4 %>% layout(title = "H3K4me3 enrichment on svbF7 bound or not by Svb (Rep condition)")
fig4
1.2.3.2.3 Rapport K4me1/ K4me3
1.2.3.2.3.1 Ctrl
total_K4me1_S2 = 8782
total_K4me3_S2 = 4812
rapp_fixe = round((contingence_H3K4me1_fixe_ctrl[1,1] / total_K4me1_S2 ) / (contingence_H3K4me3_fixe_ctrl[1,1] / total_K4me3_S2),2)
rapp_nonfixe = round((contingence_H3K4me1_nonfixe_ctrl[1,1] / total_K4me1_S2)  / (contingence_H3K4me3_nonfixe_ctrl[1,1] / total_K4me3_S2) ,2)

Il y a 0.94 fois de H3K4me1 que de H3K4me3 fixé.

Il y a 0.62 fois de H3K4me1 que de H3K4me3 non fixé.

1.2.3.2.3.2 Act
total_K4me1_S2 = 8782
total_K4me3_S2 = 4812
rapp_fixe = round((contingence_H3K4me1_fixe_act [1,1] / total_K4me1_S2 ) / (contingence_H3K4me3_fixe_act[1,1] / total_K4me3_S2),2)
rapp_nonfixe = round((contingence_H3K4me1_nonfixe_act[1,1] / total_K4me1_S2)  / (contingence_H3K4me3_nonfixe_act[1,1] / total_K4me3_S2) ,2)

Il y a 1.24 fois de H3K4me1 que de H3K4me3 fixé.

Il y a 1.58 fois de H3K4me1 que de H3K4me3 non fixé.

1.2.3.2.3.3 Rep
total_K4me1_S2 = 8782
total_K4me3_S2 = 4812
rapp_fixe = round((contingence_H3K4me1_fixe_rep[1,1] / total_K4me1_S2 ) / (contingence_H3K4me3_fixe_rep[1,1] / total_K4me3_S2),2)
rapp_nonfixe = round((contingence_H3K4me1_nonfixe_rep[1,1] / total_K4me1_S2)  / (contingence_H3K4me3_nonfixe_rep[1,1] / total_K4me3_S2) ,2)

1.2.3.3 H3K27ac

1.2.3.3.1 Ctrl
in H3K27ac absent H3K27ac
in svbF7 unbound 213 1176
absent svbF7 unbound 5418 9019
in H3K27ac absent H3K27ac
in svbF7 bound 446 40
absent svbF7 bound 5189 10357
pvalue_fixe = phyper(446 - 1, 486, 16032 - 486, 5635)
pvalue_nonfixe = phyper(213 - 1, 1389, 15826 - 1389, 5631)
presence = c(446,5189)
absence = c(40,10357)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K27ac_fixe = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K27ac_fixe)

presence = c(213,5418)
absence = c(1176,9019)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K27ac_nonfixe = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K27ac_nonfixe)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 1.789608210^{-69}

La pvalue du test de fisher pour les motifs fixé est de 1.388775210^{-156} Celle du test de fisher pour les motifs non fixé est de 9.597761510^{-69}`

total_svbF7_unbound_H3K27ac = 213 + 1176
total_svbF7_bound_H3K27ac = 446 + 40

percent_svbf7_H3K27ac_unbound = round(100 * 213 / total_svbF7_unbound_H3K27ac, 2 ) 
percent_svbf7_unbound_without_H3K27ac = round(100 * 1176 / total_svbF7_unbound_H3K27ac, 2 ) 

percent_svbf7_H3K27ac_bound = round(100 * 446 / total_svbF7_bound_H3K27ac, 2 ) 
percent_svbf7_bound_without_H3K27ac = round(100 * 40 / total_svbF7_bound_H3K27ac, 2 ) 


etat_svb = c("svbF7_bound","svb_unbound")
H3K27ac_absent = c(percent_svbf7_bound_without_H3K27ac,percent_svbf7_unbound_without_H3K27ac)

H3K27ac_present = c(percent_svbf7_H3K27ac_bound,percent_svbf7_H3K27ac_unbound)

data_H3K27ac_ctrl = data.frame(etat_svb,H3K27ac_absent,H3K27ac_present)
datatable(data_H3K27ac_ctrl,rownames = F,filter = "none",colnames = c("Regions without H3K27ac","Regions with H3K27ac" ))
fig1 = plot_ly(data_H3K27ac_ctrl, x = ~etat_svb,y = ~H3K27ac_present, type = "bar",name = "H3K27ac present", color = I("blue"))
fig1 = fig1 %>% add_trace(y = ~H3K27ac_absent, name = "H3K27ac absent", color = I("grey"))
fig1 = fig1 %>% layout(yaxis = list(title = "percent"))
fig1 = fig1 %>% layout(title = "H3K27ac enrichment on svbF7 bound or not by Svb ( Ctrl condition)", barmode = "stack")
fig1
fig1 = plot_ly(data_H3K27ac_ctrl, x = ~etat_svb,y = ~H3K27ac_present, type = "bar",name = "H3K27ac present", color = I("blue"))
fig1 = fig1 %>% add_trace(y = ~H3K27ac_absent, name = "H3K27ac absent", color = I("grey"))
fig1 = fig1 %>% layout(yaxis = list(title = "percent"))
fig1 = fig1 %>% layout(title = "H3K27ac enrichment on svbF7 bound or not by Svb ( Ctrl condition)")
fig1
1.2.3.3.2 Act
in H3K27ac absent H3K27ac
in svbF7 unbound 206 1183
absent svbF7 unbound 5471 9125
in H3K27ac absent H3K27ac
in svbF7 bound 445 41
absent svbF7 bound 5236 10473
pvalue_fixe = phyper(445 - 1, 486, 166195 - 486, 5681)
pvalue_nonfixe = phyper(206 - 1, 1389, 15985 - 1389, 5677)
presence = c(445,5236)
absence = c(41,10473)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K27ac_fixe = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K27ac_fixe)

presence = c(206,5471)
absence = c(1183,9125)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K27ac_nonfixe = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K27ac_nonfixe)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 9.47918510^{-73}

La pvalue du test de fisher pour les motifs fixé est de 1.405424510^{-155} Celle du test de fisher pour les motifs non fixé est de 4.607645810^{-72}`

total_svbF7_unbound_H3K27ac = 206 + 1183
total_svbF7_bound_H3K27ac = 445 + 41

percent_svbf7_H3K27ac_unbound = round(100 * 206 / total_svbF7_unbound_H3K27ac, 2 ) 
percent_svbf7_unbound_without_H3K27ac = round(100 * 1183 / total_svbF7_unbound_H3K27ac, 2 ) 

percent_svbf7_H3K27ac_bound = round(100 * 445 / total_svbF7_bound_H3K27ac, 2 ) 
percent_svbf7_bound_without_H3K27ac = round(100 * 41 / total_svbF7_bound_H3K27ac, 2 ) 


etat_svb = c("svbF7_bound","svb_unbound")
H3K27ac_absent = c(percent_svbf7_bound_without_H3K27ac,percent_svbf7_unbound_without_H3K27ac)

H3K27ac_present = c(percent_svbf7_H3K27ac_bound,percent_svbf7_H3K27ac_unbound)

data_H3K27ac_act = data.frame(etat_svb,H3K27ac_absent,H3K27ac_present)
datatable(data_H3K27ac_act,rownames = F,filter = "none",colnames = c("Regions without H3K27ac","Regions with H3K27ac" ))
fig1 = plot_ly(data_H3K27ac_act, x = ~etat_svb,y = ~H3K27ac_present, type = "bar",name = "H3K27ac present", color = I("blue"))
fig1 = fig1 %>% add_trace(y = ~H3K27ac_absent, name = "H3K27ac absent", color = I("grey"))
fig1 = fig1 %>% layout(yaxis = list(title = "percent"))
fig1 = fig1 %>% layout(title = "H3K27ac enrichment on svbF7 bound or not by Svb ( Act Condtion) ", barmode = "stack")
fig1
fig1 = plot_ly(data_H3K27ac_act, x = ~etat_svb,y = ~H3K27ac_present, type = "bar",name = "H3K27ac present", color = I("blue"))
fig1 = fig1 %>% add_trace(y = ~H3K27ac_absent, name = "H3K27ac absent", color = I("grey"))
fig1 = fig1 %>% layout(yaxis = list(title = "percent"))
fig1 = fig1 %>% layout(title = "H3K27ac enrichment on svbF7 bound or not by Svb ( Act Condtion) ")
fig1
1.2.3.3.3 Rep
in H3K27ac absent H3K27ac
in svbF7 unbound 206 1183
absent svbF7 unbound 5425 9033
in H3K27ac absent H3K27ac
in svbF7 bound 440 46
absent svbF7 bound 5294 10374
pvalue_fixe = phyper(440 - 1, 486, 16054 - 486, 5634)
pvalue_nonfixe = phyper(106 - 1, 1389, 15847 - 1389, 5631)
presence = c(440,5294)
absence = c(46,10374)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K27ac_fixe = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K27ac_fixe)

presence = c(206,5425)
absence = c(1183,9033)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K27ac_nonfixe = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K27ac_nonfixe)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 3.024282210^{-142}

La pvalue du test de fisher pour les motifs fixé est de 7.595208310^{-147} Celle du test de fisher pour les motifs non fixé est de 3.794733510^{-72}`

total_svbF7_unbound_H3K27ac = 206 + 1183
total_svbF7_bound_H3K27ac = 440 + 46

percent_svbf7_H3K27ac_unbound = round(100 * 206 / total_svbF7_unbound_H3K27ac, 2 ) 
percent_svbf7_unbound_without_H3K27ac = round(100 * 1183 / total_svbF7_unbound_H3K27ac, 2 ) 

percent_svbf7_H3K27ac_bound = round(100 * 440 / total_svbF7_bound_H3K27ac, 2 ) 
percent_svbf7_bound_without_H3K27ac = round(100 * 46 / total_svbF7_bound_H3K27ac, 2 ) 


etat_svb = c("svbF7_bound","svb_unbound")
H3K27ac_absent = c(percent_svbf7_bound_without_H3K27ac,percent_svbf7_unbound_without_H3K27ac)

H3K27ac_present = c(percent_svbf7_H3K27ac_bound,percent_svbf7_H3K27ac_unbound)

data_H3K27ac_rep = data.frame(etat_svb,H3K27ac_absent,H3K27ac_present)
datatable(data_H3K27ac_rep,rownames = F,filter = "none",colnames = c("Regions without H3K27ac","Regions with H3K27ac" ))
fig1 = plot_ly(data_H3K27ac_rep, x = ~etat_svb,y = ~H3K27ac_present, type = "bar",name = "H3K27ac present", color = I("blue"))
fig1 = fig1 %>% add_trace(y = ~H3K27ac_absent, name = "H3K27ac absent", color = I("grey"))
fig1 = fig1 %>% layout(yaxis = list(title = "percent"))
fig1 = fig1 %>% layout(title = "H3K27ac enrichment on svbF7 bound or not by Svb ( Rep condition) ", barmode = "stack")
fig1
fig1 = plot_ly(data_H3K27ac_rep, x = ~etat_svb,y = ~H3K27ac_present, type = "bar",name = "H3K27ac present", color = I("blue"))
fig1 = fig1 %>% add_trace(y = ~H3K27ac_absent, name = "H3K27ac absent", color = I("grey"))
fig1 = fig1 %>% layout(yaxis = list(title = "percent"))
fig1 = fig1 %>% layout(title = "H3K27ac enrichment on svbF7 bound or not by Svb ( Rep condition) ")
fig1

1.2.3.4 H3K27me3

1.2.3.4.1 Ctrl
in H3K27me3 absent H3K27me3
in svbF7 unbound 1928 0
absent svbF7 unbound 13199 0
in H3K27me3 absent H3K27me3
in svbF7 bound 410 76
absent svbF7 bound 14717 87
pvalue_fixe = phyper(410 - 1, 486, 15290 - 486, 15127)
pvalue_nonfixe = phyper(1928 - 1, 1389, 15127 - 1389, 15127)
presence = c(410,14717)
absence = c(76,87)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K27me3_fixe = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K27me3_fixe)

presence = c(1928,13199)
absence = c(0,0)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K27me3_nonfixe = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K27me3_nonfixe)

La pvalue du test de hypergéométrique pour les motifs fixé est de 5.489481710^{-72} Celle du test de hypergéométrique pour les motifs non fixé est de 1

La pvalue du test de fisher pour les motifs fixé est de 1.745591210^{-70} Celle du test de fisher pour les motifs non fixé est de 1`

total_svbF7_unbound_H3K27me3 = 1928 + 0
total_svbF7_bound_H3K27me3 = 410 + 76

percent_svbf7_H3K27me3_unbound = round(100 * 1928 / total_svbF7_unbound_H3K27me3, 2 ) 
percent_svbf7_unbound_without_H3K27me3 = round(100 * 0 / total_svbF7_unbound_H3K27me3, 2 ) 

percent_svbf7_H3K27me3_bound = round(100 * 410 / total_svbF7_bound_H3K27me3, 2 ) 
percent_svbf7_bound_without_H3K27me3 = round(100 * 76 / total_svbF7_bound_H3K27me3, 2 ) 


etat_svb = c("svbF7_bound","svbF7_unbound")
H3K27me3_absent = c(percent_svbf7_bound_without_H3K27me3,percent_svbf7_unbound_without_H3K27me3)

H3K27me3_present = c(percent_svbf7_H3K27me3_bound,percent_svbf7_H3K27me3_unbound)

data_H3K27me3_ctrl = data.frame(etat_svb,H3K27me3_absent,H3K27me3_present)
datatable(data_H3K27me3_ctrl,rownames = F,filter = "none",colnames = c("Regions without H3K27me3","Regions with H3K27me3" ))
fig2 = plot_ly(data_H3K27me3_ctrl, x = ~etat_svb,y = ~H3K27me3_present, type = "bar",name = "H3K27me3 present", color =I("purple"))
fig2 = fig2 %>% add_trace(y = ~H3K27me3_absent, name = "H3K27me3 absent",color = I("grey"))
fig2 = fig2 %>% layout(yaxis = list(title = "percent"))
fig2 = fig2 %>% layout(title = "H3K27me3 enrichment on svbF7 bound or not by Svb (Ctrl condition)", barmode = "stack")
fig2
fig2 = plot_ly(data_H3K27me3_ctrl, x = ~etat_svb,y = ~H3K27me3_present, type = "bar",name = "H3K27me3 present", color =I("purple"))
fig2 = fig2 %>% add_trace(y = ~H3K27me3_absent, name = "H3K27me3 absent",color = I("grey"))
fig2 = fig2 %>% layout(yaxis = list(title = "percent"))
fig2 = fig2 %>% layout(title = "H3K27me3 enrichment on svbF7 bound or not by Svb (Ctrl condition)")
fig2
1.2.3.4.2 Act
in H3K27me3 absent H3K27me3
in svbF7 unbound 1863 0
absent svbF7 unbound 12446 119
in H3K27me3 absent H3K27me3
in svbF7 bound 410 76
absent svbF7 bound 14717 87
pvalue_fixe = phyper(410 - 1, 486, 15290 - 486, 15127)
pvalue_nonfixe = phyper(1863 - 1, 1389, 14428 - 1389, 14309)
presence = c(410,14717)
absence = c(76,87)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K27me3_fixe = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K27me3_fixe)

presence = c(1863,12446)
absence = c(0,119)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K27me3_nonfixe = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K27me3_nonfixe)

La pvalue du test de hypergéométrique pour les motifs fixé est de 5.489481710^{-72} Celle du test de hypergéométrique pour les motifs non fixé est de 1

La pvalue du test de fisher pour les motifs fixé est de 1.745591210^{-70} Celle du test de fisher pour les motifs non fixé est de 1.176369110^{-7}`

total_svbF7_unbound_H3K27me3 =  1863+ 0
total_svbF7_bound_H3K27me3 = 410 + 76

percent_svbf7_H3K27me3_unbound = round(100 * 1863 / total_svbF7_unbound_H3K27me3, 2 ) 
percent_svbf7_unbound_without_H3K27me3 = round(100 * 0 / total_svbF7_unbound_H3K27me3, 2 ) 

percent_svbf7_H3K27me3_bound = round(100 * 410 / total_svbF7_bound_H3K27me3, 2 ) 
percent_svbf7_bound_without_H3K27me3 = round(100 * 76 / total_svbF7_bound_H3K27me3, 2 ) 


etat_svb = c("svbF7_bound","svbF7_unbound")
H3K27me3_absent = c(percent_svbf7_bound_without_H3K27me3,percent_svbf7_unbound_without_H3K27me3)

H3K27me3_present = c(percent_svbf7_H3K27me3_bound,percent_svbf7_H3K27me3_unbound)

data_H3K27me3_act = data.frame(etat_svb,H3K27me3_absent,H3K27me3_present)
datatable(data_H3K27me3_act,rownames = F,filter = "none",colnames = c("Regions without H3K27me3","Regions with H3K27me3" ))
fig2 = plot_ly(data_H3K27me3_act, x = ~etat_svb,y = ~H3K27me3_present, type = "bar",name = "H3K27me3 present", color =I("purple"))
fig2 = fig2 %>% add_trace(y = ~H3K27me3_present, name = "H3K27me3 absent",color = I("grey"))
fig2 = fig2 %>% layout(yaxis = list(title = "percent"))
fig2 = fig2 %>% layout(title = "H3K27me3 enrichment on svbF7 bound or not by Svb ( Act condition ) ", barmode = "stack")
fig2
fig2 = plot_ly(data_H3K27me3_act, x = ~etat_svb,y = ~H3K27me3_present, type = "bar",name = "H3K27me3 present", color =I("purple"))
fig2 = fig2 %>% add_trace(y = ~H3K27me3_present, name = "H3K27me3 absent",color = I("grey"))
fig2 = fig2 %>% layout(yaxis = list(title = "percent"))
fig2 = fig2 %>% layout(title = "H3K27me3 enrichment on svbF7 bound or not by Svb ( Act condition ) ")
fig2
1.2.3.4.3 Rep
in H3K27me3 absent H3K27me3
in svbF7 unbound 1878 0
absent svbF7 unbound 13423 0
in H3K27me3 absent H3K27me3
in svbF7 bound 452 34
absent svbF7 bound 14849 0
pvalue_fixe = phyper(452 - 1, 486, 15335 - 486, 15301)
pvalue_nonfixe = phyper(1878 - 1, 1389, 15301 - 1389, 15301)
presence = c(452,14849)
absence = c(34,0)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K27me3_fixe = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K27me3_fixe)

presence = c(1878,13423)
absence = c(0,0)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K27me3_nonfixe = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K27me3_nonfixe)

La pvalue du test de hypergéométrique pour les motifs fixé est de 0 Celle du test de hypergéométrique pour les motifs non fixé est de 1

La pvalue du test de fisher pour les motifs fixé est de 3.427962810^{-52} Celle du test de fisher pour les motifs non fixé est de 1`

total_svbF7_unbound_H3K27me3 =  1878+ 0
total_svbF7_bound_H3K27me3 = 452 + 34

percent_svbf7_H3K27me3_unbound = round(100 * 1878 / total_svbF7_unbound_H3K27me3, 2 ) 
percent_svbf7_unbound_without_H3K27me3 = round(100 * 0 / total_svbF7_unbound_H3K27me3, 2 ) 

percent_svbf7_H3K27me3_bound = round(100 * 452 / total_svbF7_bound_H3K27me3, 2 ) 
percent_svbf7_bound_without_H3K27me3 = round(100 * 34 / total_svbF7_bound_H3K27me3, 2 ) 


etat_svb = c("svbF7_bound","svbF7_unbound")
H3K27me3_absent = c(percent_svbf7_bound_without_H3K27me3,percent_svbf7_unbound_without_H3K27me3)

H3K27me3_present = c(percent_svbf7_H3K27me3_bound,percent_svbf7_H3K27me3_unbound)

data_H3K27me3_rep = data.frame(etat_svb,H3K27me3_absent,H3K27me3_present)
datatable(data_H3K27me3_rep,rownames = F,filter = "none",colnames = c("Regions without H3K27me3","Regions with H3K27me3" ))
fig2 = plot_ly(data_H3K27me3_rep, x = ~etat_svb,y = ~H3K27me3_present, type = "bar",name = "H3K27me3 present", color =I("purple"))
fig2 = fig2 %>% add_trace(y = ~H3K27me3_absent, name = "H3K27me3 absent",color = I("grey"))
fig2 = fig2 %>% layout(yaxis = list(title = "percent"))
fig2 = fig2 %>% layout(title = "H3K27me3 enrichment on svbF7 bound or not by Svb ( Rep condition ) ", barmode = "stack")
fig2
fig2 = plot_ly(data_H3K27me3_rep, x = ~etat_svb,y = ~H3K27me3_present, type = "bar",name = "H3K27me3 present", color =I("purple"))
fig2 = fig2 %>% add_trace(y = ~H3K27me3_absent, name = "H3K27me3 absent",color = I("grey"))
fig2 = fig2 %>% layout(yaxis = list(title = "percent"))
fig2 = fig2 %>% layout(title = "H3K27me3 enrichment on svbF7 bound or not by Svb ( Rep condition ) ")
fig2

1.2.4 Pics associés aux gènes cibles directes de Svb

Je regarde ici l’enrichisement en histones des motifs de Svb en présence des différentes formes de Svb ( Act/ Rep) et Ctrl sur les pics associés aux gènes cibles directes

1.2.4.1 H3K4me1

1.2.4.1.1 Ctrl
in H3K4me1 absent H3K4me1
in svbF7 unbound 1415 372
absent svbF7 unbound 8771 4422
in H3K4me1 absent H3K4me1
in svbF7 bound 67 0
absent svbF7 bound 10129 5142
pvalue_fixe = phyper(67 - 1, 45, 15338 - 45, 10196)
pvalue_nonfixe = phyper(1415 - 1, 1787, 14980 - 1787, 10186)
presence = c(67,10129)
absence = c(0,5142)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K4me1_fixe_ctrl = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K4me1_fixe_ctrl)

presence = c(1415,8771)
absence = c(372,4422)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K4me1_nonfixe_ctrl = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K4me1_nonfixe_ctrl)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 1

La pvalue du test de fisher pour les motifs fixé est de 2.286749710^{-12} Celle du test de fisher pour les motifs non fixé est de 6.388705810^{-29}`

total_svbF7_unbound = 1415 + 372
total_svbF7_bound = 67 + 0

percent_svbf7_H3K4me1_unbound = round(100 * 1415 / total_svbF7_unbound, 2 ) 
percent_svbf7_unbound_without_H3K4me1 = round(100 * 372 / total_svbF7_unbound, 2 ) 

percent_svbf7_H3K4me1_bound = round(100 * 67 / total_svbF7_bound, 2 ) 
percent_svbf7_bound_without_H3K4me1 = round(100 * 0 / total_svbF7_bound, 2 ) 



etat_svb = c("svbF7_bound","svbF7_unbound")
H3K4me1_absent = c(percent_svbf7_bound_without_H3K4me1,percent_svbf7_unbound_without_H3K4me1)

H3K4me1_present = c(percent_svbf7_H3K4me1_bound,percent_svbf7_H3K4me1_unbound)

data_H3K4me1_ctrl = data.frame(etat_svb,H3K4me1_absent,H3K4me1_present)
datatable(data_H3K4me1_ctrl,rownames = F,filter = "none", colnames = c("Regions without H3K4me1","Regions with H3K4me1" ))
fig3 = plot_ly(data_H3K4me1_ctrl, x = ~etat_svb,y = ~H3K4me1_present, type = "bar",name = "H3K4me1 present", color = I("orange"))
fig3 = fig3 %>% add_trace(y = ~H3K4me1_absent, name = "H3K4me1 absent", color = I("grey"))
fig3 = fig3 %>% layout(yaxis = list(title = "percent"))
fig3 = fig3 %>% layout(title = "H3K4me1 enrichment on svbF7 bound or not by Svb (Ctrl condition)", barmode = "stack")
fig3
fig3 = plot_ly(data_H3K4me1_ctrl, x = ~etat_svb,y = ~H3K4me1_present, type = "bar",name = "H3K4me1 present", color = I("orange"))
fig3 = fig3 %>% add_trace(y = ~H3K4me1_absent, name = "H3K4me1 absent", color = I("grey"))
fig3 = fig3 %>% layout(yaxis = list(title = "percent"))
fig3 = fig3 %>% layout(title = "H3K4me1 enrichment on svbF7 bound or not by Svb (Ctrl condition)")
fig3
1.2.4.1.2 Act
in H3K4me1 absent H3K4me1
in svbF7 unbound 1637 150
absent svbF7 unbound 10600 3396
in H3K4me1 absent H3K4me1
in svbF7 bound 69 0
absent svbF7 bound 12181 3930
pvalue_fixe = phyper(68 - 1, 45, 16180 -45, 12250)
pvalue_nonfixe = phyper(1637 - 1, 1787, 15783 - 1787, 12237)
presence = c(60,12181)
absence = c(0,3930)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K4me1_fixe_act = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K4me1_fixe_act)

presence = c(1637,10600)
absence = c(150,3396)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K4me1_nonfixe_act = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K4me1_nonfixe_act)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 1

La pvalue du test de fisher pour les motifs fixé est de 7.216512910^{-8} Celle du test de fisher pour les motifs non fixé est de 1.09857510^{-61}`

total_svbF7_unbound = 1637 + 150
total_svbF7_bound = 69 + 0

percent_svbf7_H3K4me1_unbound = round(100 * 1637 / total_svbF7_unbound, 2 ) 
percent_svbf7_unbound_without_H3K4me1 = round(100 * 150 / total_svbF7_unbound, 2 ) 

percent_svbf7_H3K4me1_bound = round(100 * 69 / total_svbF7_bound, 2 ) 
percent_svbf7_bound_without_H3K4me1 = round(100 * 0 / total_svbF7_bound, 2 ) 



etat_svb = c("svbF7_bound","svbF7_unbound")
H3K4me1_absent = c(percent_svbf7_bound_without_H3K4me1,percent_svbf7_unbound_without_H3K4me1)

H3K4me1_present = c(percent_svbf7_H3K4me1_bound,percent_svbf7_H3K4me1_unbound)

data_H3K4me1_act = data.frame(etat_svb,H3K4me1_absent,H3K4me1_present)
datatable(data_H3K4me1_act,rownames = F,filter = "none", colnames = c("Regions without H3K4me1","Regions with H3K4me1" ))
fig3 = plot_ly(data_H3K4me1_act, x = ~etat_svb,y = ~H3K4me1_present, type = "bar",name = "H3K4me1 present", color = I("orange"))
fig3 = fig3 %>% add_trace(y = ~H3K4me1_absent, name = "H3K4me1 absent", color = I("grey"))
fig3 = fig3 %>% layout(yaxis = list(title = "percent"))
fig3 = fig3 %>% layout(title = "H3K4me1 enrichment on svbF7 bound or not by Svb (Act condition)", barmode = "stack")
fig3
fig3 = plot_ly(data_H3K4me1_act, x = ~etat_svb,y = ~H3K4me1_present, type = "bar",name = "H3K4me1 present", color = I("orange"))
fig3 = fig3 %>% add_trace(y = ~H3K4me1_absent, name = "H3K4me1 absent", color = I("grey"))
fig3 = fig3 %>% layout(yaxis = list(title = "percent"))
fig3 = fig3 %>% layout(title = "H3K4me1 enrichment on svbF7 bound or not by Svb (Act condition)")
fig3
1.2.4.1.3 Rep
in H3K4me1 absent H3K4me1
in svbF7 unbound 1563 224
absent svbF7 unbound 10231 3579
in H3K4me1 absent H3K4me1
in svbF7 unbound 65 0
absent svbF7 unbound 11737 4182
pvalue_fixe = phyper(65 - 1, 45, 15984 - 45, 11802)
pvalue_nonfixe = phyper(1563 - 1, 1787, 15597 - 1787, 11794)
presence = c(65,11737)
absence = c(0,4182)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K4me1_fixe_rep = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K4me1_fixe_rep)

presence = c(1563,10231)
absence = c(224,3579)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K4me1_nonfixe_rep = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K4me1_nonfixe_rep)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 1

La pvalue du test de fisher pour les motifs fixé est de 4.59151510^{-9} Celle du test de fisher pour les motifs non fixé est de 1.23021910^{-39}`

total_svbF7_unbound = 1563 + 224
total_svbF7_bound = 65 + 0

percent_svbf7_H3K4me1_unbound = round(100 * 1563 / total_svbF7_unbound, 2 ) 
percent_svbf7_unbound_without_H3K4me1 = round(100 * 224 / total_svbF7_unbound, 2 ) 

percent_svbf7_H3K4me1_bound = round(100 * 65 / total_svbF7_bound, 2 ) 
percent_svbf7_bound_without_H3K4me1 = round(100 * 0 / total_svbF7_bound, 2 ) 



etat_svb = c("svbF7_bound","svbF7_unbound")
H3K4me1_absent = c(percent_svbf7_bound_without_H3K4me1,percent_svbf7_unbound_without_H3K4me1)

H3K4me1_present = c(percent_svbf7_H3K4me1_bound,percent_svbf7_H3K4me1_unbound)

data_H3K4me1_rep = data.frame(etat_svb,H3K4me1_absent,H3K4me1_present)
datatable(data_H3K4me1_rep,rownames = F,filter = "none", colnames = c("Regions without H3K4me1","Regions with H3K4me1" ))
fig3 = plot_ly(data_H3K4me1_rep, x = ~etat_svb,y = ~H3K4me1_present, type = "bar",name = "H3K4me1 present", color = I("orange"))
fig3 = fig3 %>% add_trace(y = ~H3K4me1_absent, name = "H3K4me1 absent", color = I("grey"))
fig3 = fig3 %>% layout(yaxis = list(title = "percent"))
fig3 = fig3 %>% layout(title = "H3K4me1 enrichment on svbF7 bound or not by Svb (Rep condition)", barmode = "stack")
fig3
fig3 = plot_ly(data_H3K4me1_rep, x = ~etat_svb,y = ~H3K4me1_present, type = "bar",name = "H3K4me1 present", color = I("orange"))
fig3 = fig3 %>% add_trace(y = ~H3K4me1_absent, name = "H3K4me1 absent", color = I("grey"))
fig3 = fig3 %>% layout(yaxis = list(title = "percent"))
fig3 = fig3 %>% layout(title = "H3K4me1 enrichment on svbF7 bound or not by Svb (Rep condition)")
fig3

1.2.4.2 H3K4me3

1.2.4.2.1 Ctrl
in H3K4me3 absent H3K4me3
in svbF7 unbound 1080 707
absent svbF7 unbound 9565 6548
in H3K4me3 absent H3K4me3
in svbF7 bound 33 12
absent svbF7 bound 10612 7753
pvalue_fixe = phyper(33 - 1, 45, 18410 - 45, 10645)
pvalue_nonfixe = phyper(1080 - 1, 1787, 17900 - 1787, 10645)
presence = c(33,10612)
absence = c(12,7753)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K4me3_fixe_ctrl = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K4me3_fixe_ctrl)

presence = c(1080,956)
absence = c(707,6548)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K4me3_nonfixe_ctrl = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K4me3_nonfixe_ctrl)

La pvalue du test de hypergéométrique pour les motifs fixé est de 0.9768974 Celle du test de hypergéométrique pour les motifs non fixé est de 0.8028997

La pvalue du test de fisher pour les motifs fixé est de 0.0350842 Celle du test de fisher pour les motifs non fixé est de 0`

total_svbF7_unbound_H3K4me3 = 1080 + 707
total_svbF7_bound_H3K4me3 = 33 + 12

percent_svbf7_H3K4me3_unbound = round(100 * 1080 / total_svbF7_unbound_H3K4me3, 2 ) 
percent_svbf7_unbound_without_H3K4me3 = round(100 * 707 / total_svbF7_unbound_H3K4me3, 2 ) 

percent_svbf7_H3K4me3_bound = round(100 * 33 / total_svbF7_bound_H3K4me3, 2 ) 
percent_svbf7_bound_without_H3K4me3 = round(100 * 12 / total_svbF7_bound_H3K4me3, 2 ) 



etat_svb = c("svbF7_bound","svbF7_unbound")
H3K4me3_absent = c(percent_svbf7_bound_without_H3K4me3,percent_svbf7_unbound_without_H3K4me3)

H3K4me3_present = c(percent_svbf7_H3K4me3_bound,percent_svbf7_H3K4me3_unbound)

data_H3K4me3_ctrl = data.frame(etat_svb,H3K4me3_absent,H3K4me3_present)
datatable(data_H3K4me3_ctrl,rownames = F,filter = "none",colnames = c("Regions without H3K4me3","Regions with H3K4me3" ))
fig4 = plot_ly(data_H3K4me3_ctrl, x = ~etat_svb,y = ~H3K4me3_present, type = "bar",name = "H3K4me3 present", color = I("pink"))
fig4 = fig4 %>% add_trace(y = ~H3K4me3_absent, name = "H3K4me3 absent", color = I("grey"))
fig4 = fig4 %>% layout(yaxis = list(title = "percent"))
fig4 = fig4 %>% layout(title = "H3K4me3 enrichment on svbF7 bound or not by Svb (Ctrl condition)", barmode = "stack")
fig4
fig4 = plot_ly(data_H3K4me3_ctrl, x = ~etat_svb,y = ~H3K4me3_present, type = "bar",name = "H3K4me3 present", color = I("pink"))
fig4 = fig4 %>% add_trace(y = ~H3K4me3_absent, name = "H3K4me3 absent", color = I("grey"))
fig4 = fig4 %>% layout(yaxis = list(title = "percent"))
fig4 = fig4 %>% layout(title = "H3K4me3 enrichment on svbF7 bound or not by Svb (Ctrl condition)")
fig4
1.2.4.2.2 Act
in H3K4me3 absent H3K4me3
in svbF7 unbound 638 1149
absent svbF7 unbound 6601 9605
in H3K4me3 absent H3K4me3
in svbF7 bound 33 12
absent svbF7 bound 7207 11257
pvalue_fixe = phyper(33 - 1, 45, 18509 - 45, 7240)
pvalue_nonfixe = phyper(638 - 1, 1787, 17993 - 1787, 7239)
presence = c(33,7207)
absence = c(12,11257)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K4me3_fixe_act = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K4me3_fixe_act)

presence = c(638,6601)
absence = c(1149,9605)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K4me3_nonfixe_act = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K4me3_nonfixe_act)

La pvalue du test de hypergéométrique pour les motifs fixé est de 0.9999967 Celle du test de hypergéométrique pour les motifs non fixé est de 1.558858610^{-5}

La pvalue du test de fisher pour les motifs fixé est de 4.11252610^{-6} Celle du test de fisher pour les motifs non fixé est de 3.792336310^{-5}`

total_svbF7_unbound_H3K4me3 = 638 + 1149
total_svbF7_bound_H3K4me3 = 33 + 12

percent_svbf7_H3K4me3_unbound = round(100 * 638 / total_svbF7_unbound_H3K4me3, 2 ) 
percent_svbf7_unbound_without_H3K4me3 = round(100 * 1149 / total_svbF7_unbound_H3K4me3, 2 ) 

percent_svbf7_H3K4me3_bound = round(100 * 33 / total_svbF7_bound_H3K4me3, 2 ) 
percent_svbf7_bound_without_H3K4me3 = round(100 * 12 / total_svbF7_bound_H3K4me3, 2 ) 



etat_svb = c("svbF7_bound","svbF7_unbound")
H3K4me3_absent = c(percent_svbf7_bound_without_H3K4me3,percent_svbf7_unbound_without_H3K4me3)

H3K4me3_present = c(percent_svbf7_H3K4me3_bound,percent_svbf7_H3K4me3_unbound)

data_H3K4me3_act = data.frame(etat_svb,H3K4me3_absent,H3K4me3_present)
datatable(data_H3K4me3_act,rownames = F,filter = "none",colnames = c("Regions without H3K4me3","Regions with H3K4me3" ))
fig4 = plot_ly(data_H3K4me3_act, x = ~etat_svb,y = ~H3K4me3_present, type = "bar",name = "H3K4me3 present", color = I("pink"))
fig4 = fig4 %>% add_trace(y = ~H3K4me3_absent, name = "H3K4me3 absent", color = I("grey"))
fig4 = fig4 %>% layout(yaxis = list(title = "percent"))
fig4 = fig4 %>% layout(title = "H3K4me3 enrichment on svbF7 bound or not by Svb (Act condition)", barmode = "stack")
fig4
fig4 = plot_ly(data_H3K4me3_act, x = ~etat_svb,y = ~H3K4me3_present, type = "bar",name = "H3K4me3 present", color = I("pink"))
fig4 = fig4 %>% add_trace(y = ~H3K4me3_absent, name = "H3K4me3 absent", color = I("grey"))
fig4 = fig4 %>% layout(yaxis = list(title = "percent"))
fig4 = fig4 %>% layout(title = "H3K4me3 enrichment on svbF7 bound or not by Svb (Act condition)")
fig4
1.2.4.2.3 Rep
in H3K4me3 absent H3K4me3
in svbF7 unbound 1263 524
absent svbF7 unbound 10598 6133
in H3K4me3 absent H3K4me3
in svbF7 bound 32 13
absent svbF7 bound 4763 12483
pvalue_fixe = phyper(32 - 1, 45, 17291 - 45, 4795)
pvalue_nonfixe = phyper(1263 - 1, 1787, 18518 - 1787, 11861)
presence = c(32,4763)
absence = c(13,12483)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K4me3_fixe_rep = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K4me3_fixe_rep)

presence = c(1263,524)
absence = c(10598,6133 )
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K4me3_nonfixe_rep = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K4me3_nonfixe_rep)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 1

La pvalue du test de fisher pour les motifs fixé est de 1.783416710^{-9} Celle du test de fisher pour les motifs non fixé est de 5.398360210^{-10}`

total_svbF7_unbound_H3K4me3 = 1263 + 524
total_svbF7_bound_H3K4me3 = 32 + 13

percent_svbf7_H3K4me3_unbound = round(100 * 1263 / total_svbF7_unbound_H3K4me3, 2 ) 
percent_svbf7_unbound_without_H3K4me3 = round(100 * 524 / total_svbF7_unbound_H3K4me3, 2 ) 

percent_svbf7_H3K4me3_bound = round(100 * 32 / total_svbF7_bound_H3K4me3, 2 ) 
percent_svbf7_bound_without_H3K4me3 = round(100 * 13 / total_svbF7_bound_H3K4me3, 2 ) 



etat_svb = c("svbF7_bound","svbF7_unbound")
H3K4me3_absent = c(percent_svbf7_bound_without_H3K4me3,percent_svbf7_unbound_without_H3K4me3)

H3K4me3_present = c(percent_svbf7_H3K4me3_bound,percent_svbf7_H3K4me3_unbound)

data_H3K4me3_rep = data.frame(etat_svb,H3K4me3_absent,H3K4me3_present)
datatable(data_H3K4me3_rep,rownames = F,filter = "none",colnames = c("Regions without H3K4me3","Regions with H3K4me3" ))
fig4 = plot_ly(data_H3K4me3_rep, x = ~etat_svb,y = ~H3K4me3_present, type = "bar",name = "H3K4me3 present", color = I("pink"))
fig4 = fig4 %>% add_trace(y = ~H3K4me3_absent, name = "H3K4me3 absent", color = I("grey"))
fig4 = fig4 %>% layout(yaxis = list(title = "percent"))
fig4 = fig4 %>% layout(title = "H3K4me3 enrichment on svbF7 bound or not by Svb (Rep condition)", barmode = "stack")
fig4
fig4 = plot_ly(data_H3K4me3_rep, x = ~etat_svb,y = ~H3K4me3_present, type = "bar",name = "H3K4me3 present", color = I("pink"))
fig4 = fig4 %>% add_trace(y = ~H3K4me3_absent, name = "H3K4me3 absent", color = I("grey"))
fig4 = fig4 %>% layout(yaxis = list(title = "percent"))
fig4 = fig4 %>% layout(title = "H3K4me3 enrichment on svbF7 bound or not by Svb (Rep condition)")
fig4
1.2.4.2.4 Rapport K4me1/ K4me3
1.2.4.2.4.1 Ctrl
total_K4me1_S2 = 8782
total_K4me3_S2 = 4812
rapp_fixe = round((contingence_H3K4me1_fixe_ctrl[1,1] / total_K4me1_S2 ) / (contingence_H3K4me3_fixe_ctrl[1,1] / total_K4me3_S2),2)
rapp_nonfixe = round((contingence_H3K4me1_nonfixe_ctrl[1,1] / total_K4me1_S2)  / (contingence_H3K4me3_nonfixe_ctrl[1,1] / total_K4me3_S2) ,2)

Il y a 1.11 fois de H3K4me1 que de H3K4me3 fixé.

Il y a 0.72 fois de H3K4me1 que de H3K4me3 non fixé.

1.2.4.2.4.2 Act
total_K4me1_S2 = 8782
total_K4me3_S2 = 4812
rapp_fixe = round((contingence_H3K4me1_fixe_act [1,1] / total_K4me1_S2 ) / (contingence_H3K4me3_fixe_act[1,1] / total_K4me3_S2),2)
rapp_nonfixe = round((contingence_H3K4me1_nonfixe_act[1,1] / total_K4me1_S2)  / (contingence_H3K4me3_nonfixe_act[1,1] / total_K4me3_S2) ,2)

Il y a 1 fois de H3K4me1 que de H3K4me3 fixé.

Il y a 1.41 fois de H3K4me1 que de H3K4me3 non fixé.

1.2.4.2.4.3 Rep
total_K4me1_S2 = 8782
total_K4me3_S2 = 4812
rapp_fixe = round((contingence_H3K4me1_fixe_rep[1,1] / total_K4me1_S2 ) / (contingence_H3K4me3_fixe_rep[1,1] / total_K4me3_S2),2)
rapp_nonfixe = round((contingence_H3K4me1_nonfixe_rep[1,1] / total_K4me1_S2)  / (contingence_H3K4me3_nonfixe_rep[1,1] / total_K4me3_S2) ,2)

1.2.4.3 H3K27ac

1.2.4.3.1 Ctrl
in H3K27ac absent H3K27ac
in svbF7 unbound 602 1185
absent svbF7 unbound 5029 8890
in H3K27ac absent H3K27ac
in svbF7 bound 43 2
absent svbF7 bound 5592 10461
pvalue_fixe = phyper(43 - 1, 45, 16098 - 45, 5635)
pvalue_nonfixe = phyper(602 - 1, 1787, 15706 - 1787, 5631)
presence = c(43,5592)
absence = c(2,10461)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K27ac_fixe = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K27ac_fixe)

presence = c(602,5029)
absence = c(1185,8890)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K27ac_nonfixe = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K27ac_nonfixe)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 0.019714

La pvalue du test de fisher pour les motifs fixé est de 9.685414710^{-18} Celle du test de fisher pour les motifs non fixé est de 0.0436541`

total_svbF7_unbound_H3K27ac = 602 + 1185
total_svbF7_bound_H3K27ac = 43 + 2

percent_svbf7_H3K27ac_unbound = round(100 * 602 / total_svbF7_unbound_H3K27ac, 2 ) 
percent_svbf7_unbound_without_H3K27ac = round(100 * 1185 / total_svbF7_unbound_H3K27ac, 2 ) 

percent_svbf7_H3K27ac_bound = round(100 * 43 / total_svbF7_bound_H3K27ac, 2 ) 
percent_svbf7_bound_without_H3K27ac = round(100 * 2 / total_svbF7_bound_H3K27ac, 2 ) 


etat_svb = c("svbF7_bound","svb_unbound")
H3K27ac_absent = c(percent_svbf7_bound_without_H3K27ac,percent_svbf7_unbound_without_H3K27ac)



etat_svb = c("svbF7_bound","svb_unbound")
H3K27ac_absent = c(percent_svbf7_bound_without_H3K27ac,percent_svbf7_unbound_without_H3K27ac)

H3K27ac_present = c(percent_svbf7_H3K27ac_bound,percent_svbf7_H3K27ac_unbound)

data_H3K27ac_ctrl = data.frame(etat_svb,H3K27ac_absent,H3K27ac_present)
datatable(data_H3K27ac_ctrl,rownames = F,filter = "none",colnames = c("Regions without H3K27ac","Regions with H3K27ac" ))
fig1 = plot_ly(data_H3K27ac_ctrl, x = ~etat_svb,y = ~H3K27ac_present, type = "bar",name = "H3K27ac present", color = I("blue"))
fig1 = fig1 %>% add_trace(y = ~H3K27ac_present, name = "H3K27ac absent", color = I("grey"))
fig1 = fig1 %>% layout(yaxis = list(title = "percent"))
fig1 = fig1 %>% layout(title = "H3K27ac enrichment on svbF7 bound or not by Svb ( Ctrl Condtion) ", barmode = "stack")
fig1
fig1 = plot_ly(data_H3K27ac_ctrl, x = ~etat_svb,y = ~H3K27ac_present, type = "bar",name = "H3K27ac present", color = I("blue"))
fig1 = fig1 %>% add_trace(y = ~H3K27ac_present, name = "H3K27ac absent", color = I("grey"))
fig1 = fig1 %>% layout(yaxis = list(title = "percent"))
fig1 = fig1 %>% layout(title = "H3K27ac enrichment on svbF7 bound or not by Svb ( Ctrl Condtion) ")
fig1
1.2.4.3.2 Act
in H3K27ac absent H3K27ac
in svbF7 unbound 596 1191
absent svbF7 unbound 5081 8995
in H3K27ac absent H3K27ac
in svbF7 bound 43 2
absent svbF7 bound 5638 10579
pvalue_fixe = phyper(43 - 1, 45, 16262 - 45, 5681)
pvalue_nonfixe = phyper(596 - 1, 1787, 15863 - 1787, 5677)
presence = c(43,5638)
absence = c(2,10579)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K27ac_fixe = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K27ac_fixe)

presence = c(596,5081)
absence = c(1191,8995)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K27ac_nonfixe = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K27ac_nonfixe)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 0.0103025

La pvalue du test de fisher pour les motifs fixé est de 8.909640810^{-18} Celle du test de fisher pour les motifs non fixé est de 0.0226837`

total_svbF7_unbound_H3K27ac = 596 + 1191
total_svbF7_bound_H3K27ac = 43 + 2

percent_svbf7_H3K27ac_unbound = round(100 * 596 / total_svbF7_unbound_H3K27ac, 2 ) 
percent_svbf7_unbound_without_H3K27ac = round(100 * 1191 / total_svbF7_unbound_H3K27ac, 2 ) 

percent_svbf7_H3K27ac_bound = round(100 * 43 / total_svbF7_bound_H3K27ac, 2 ) 
percent_svbf7_bound_without_H3K27ac = round(100 * 2 / total_svbF7_bound_H3K27ac, 2 ) 


etat_svb = c("svbF7_bound","svb_unbound")
H3K27ac_absent = c(percent_svbf7_bound_without_H3K27ac,percent_svbf7_unbound_without_H3K27ac)

H3K27ac_present = c(percent_svbf7_H3K27ac_bound,percent_svbf7_H3K27ac_unbound)

data_H3K27ac_act = data.frame(etat_svb,H3K27ac_absent,H3K27ac_present)
datatable(data_H3K27ac_act,rownames = F,filter = "none",colnames = c("Regions without H3K27ac","Regions with H3K27ac" ))
fig1 = plot_ly(data_H3K27ac_act, x = ~etat_svb,y = ~H3K27ac_absent, type = "bar",name = "H3K27ac absent", color = I("grey"))
fig1 = fig1 %>% add_trace(y = ~H3K27ac_present, name = "H3K27ac present", color = I("blue"))
fig1 = fig1 %>% layout(yaxis = list(title = "percent"))
fig1 = fig1 %>% layout(title = "H3K27ac enrichment on svbF7 bound or not by Svb ( Act Condtion) ", barmode = "stack")
fig1
fig1 = plot_ly(data_H3K27ac_act, x = ~etat_svb,y = ~H3K27ac_present, type = "bar",name = "H3K27ac present", color = I("blue"))
fig1 = fig1 %>% add_trace(y = ~H3K27ac_absent, name = "H3K27ac absent", color = I("grey"))
fig1 = fig1 %>% layout(yaxis = list(title = "percent"))
fig1 = fig1 %>% layout(title = "H3K27ac enrichment on svbF7 bound or not by Svb ( Act Condtion) ", barmode = "stack")
fig1
fig1 = plot_ly(data_H3K27ac_act, x = ~etat_svb,y = ~H3K27ac_present, type = "bar",name = "H3K27ac present", color = I("blue"))
fig1 = fig1 %>% add_trace(y = ~H3K27ac_absent, name = "H3K27ac absent", color = I("grey"))
fig1 = fig1 %>% layout(yaxis = list(title = "percent"))
fig1 = fig1 %>% layout(title = "H3K27ac enrichment on svbF7 bound or not by Svb ( Act Condtion) ")
fig1
1.2.4.3.3 Rep
in H3K27ac absent H3K27ac
in svbF7 unbound 594 1193
absent svbF7 unbound 5037 8903
in H3K27ac absent H3K27ac
in svbF7 bound 38 7
absent svbF7 bound 5596 10479
pvalue_fixe = phyper(38 - 1, 45, 16120 - 45, 5634)
pvalue_nonfixe = phyper(594 - 1, 1787, 15727 - 1787, 5631)
presence = c(38,5596)
absence = c(7,10479)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K27ac_fixe = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K27ac_fixe)

presence = c(594,5037)
absence = c(1193,8903)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K27ac_nonfixe = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K27ac_nonfixe)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 0.007383

La pvalue du test de fisher pour les motifs fixé est de 1.035723410^{-11} Celle du test de fisher pour les motifs non fixé est de 0.0170752`

total_svbF7_unbound_H3K27ac = 594 + 1193
total_svbF7_bound_H3K27ac = 38 + 7

percent_svbf7_H3K27ac_unbound = round(100 * 594 / total_svbF7_unbound_H3K27ac, 2 ) 
percent_svbf7_unbound_without_H3K27ac = round(100 * 1193 / total_svbF7_unbound_H3K27ac, 2 ) 

percent_svbf7_H3K27ac_bound = round(100 * 38 / total_svbF7_bound_H3K27ac, 2 ) 
percent_svbf7_bound_without_H3K27ac = round(100 * 7 / total_svbF7_bound_H3K27ac, 2 ) 


etat_svb = c("svbF7_bound","svb_unbound")
H3K27ac_absent = c(percent_svbf7_bound_without_H3K27ac,percent_svbf7_unbound_without_H3K27ac)

H3K27ac_present = c(percent_svbf7_H3K27ac_bound,percent_svbf7_H3K27ac_unbound)

data_H3K27ac_rep = data.frame(etat_svb,H3K27ac_absent,H3K27ac_present)
datatable(data_H3K27ac_rep,rownames = F,filter = "none",colnames = c("Regions without H3K27ac","Regions with H3K27ac" ))
fig1 = plot_ly(data_H3K27ac_rep, x = ~etat_svb,y = ~H3K27ac_present, type = "bar",name = "H3K27ac present", color = I("blue"))
fig1 = fig1 %>% add_trace(y = ~H3K27ac_absent, name = "H3K27ac absent", color = I("grey"))
fig1 = fig1 %>% layout(yaxis = list(title = "percent"))
fig1 = fig1 %>% layout(title = "H3K27ac enrichment on svbF7 bound or not by Svb ( Rep condition) ", barmode = "stack")
fig1
fig1 = plot_ly(data_H3K27ac_rep, x = ~etat_svb,y = ~H3K27ac_present, type = "bar",name = "H3K27ac present", color = I("blue"))
fig1 = fig1 %>% add_trace(y = ~H3K27ac_absent, name = "H3K27ac absent", color = I("grey"))
fig1 = fig1 %>% layout(yaxis = list(title = "percent"))
fig1 = fig1 %>% layout(title = "H3K27ac enrichment on svbF7 bound or not by Svb ( Rep condition) ")
fig1

1.2.4.4 H3K27me3

1.2.4.4.1 Ctrl
in H3K27me3 absent H3K27me3
in svbF7 unbound 2268 0
absent svbF7 unbound 12859 0
in H3K27me3 absent H3K27me3
in svbF7 bound 43 2
absent svbF7 bound 15084 220
pvalue_fixe = phyper(43 - 1, 45, 15349 - 45, 15127)
pvalue_nonfixe = phyper(2268 - 1, 1787, 15127 - 1787, 15127)
presence = c(43,15084)
absence = c(2,220)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K27me3_fixe = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K27me3_fixe)

presence = c(2268,15084)
absence = c(0,0)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K27me3_nonfixe = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K27me3_nonfixe)

La pvalue du test de hypergéométrique pour les motifs fixé est de 0.0271347 Celle du test de hypergéométrique pour les motifs non fixé est de 1

La pvalue du test de fisher pour les motifs fixé est de 0.1378574 Celle du test de fisher pour les motifs non fixé est de 1`

total_svbF7_unbound_H3K27me3 = 2268 + 0
total_svbF7_bound_H3K27me3 = 43 + 2

percent_svbf7_H3K27me3_unbound = round(100 * 2268 / total_svbF7_unbound_H3K27me3, 2 ) 
percent_svbf7_unbound_without_H3K27me3 = round(100 * 0 / total_svbF7_unbound_H3K27me3, 2 ) 

percent_svbf7_H3K27me3_bound = round(100 * 43 / total_svbF7_bound_H3K27me3, 2 ) 
percent_svbf7_bound_without_H3K27me3 = round(100 * 2 / total_svbF7_bound_H3K27me3, 2 ) 


etat_svb = c("svbF7_bound","svbF7_unbound")
H3K27me3_absent = c(percent_svbf7_bound_without_H3K27me3,percent_svbf7_unbound_without_H3K27me3)

H3K27me3_present = c(percent_svbf7_H3K27me3_bound,percent_svbf7_H3K27me3_unbound)

data_H3K27me3_ctrl = data.frame(etat_svb,H3K27me3_absent,H3K27me3_present)
datatable(data_H3K27me3_ctrl,rownames = F,filter = "none",colnames = c("Regions without H3K27me3","Regions with H3K27me3" ))
fig2 = plot_ly(data_H3K27me3_ctrl, x = ~etat_svb,y = ~H3K27me3_present, type = "bar",name = "H3K27me3 present", color =I("purple"))
fig2 = fig2 %>% add_trace(y = ~H3K27me3_absent, name = "H3K27me3 absent",color = I("grey"))
fig2 = fig2 %>% layout(yaxis = list(title = "percent"))
fig2 = fig2 %>% layout(title = "H3K27me3 enrichment on svbF7 bound or not by Svb (Ctrl condition)", barmode = "stack")
fig2
fig2 = plot_ly(data_H3K27me3_ctrl, x = ~etat_svb,y = ~H3K27me3_present, type = "bar",name = "H3K27me3 present", color =I("purple"))
fig2 = fig2 %>% add_trace(y = ~H3K27me3_absent, name = "H3K27me3 absent",color = I("grey"))
fig2 = fig2 %>% layout(yaxis = list(title = "percent"))
fig2 = fig2 %>% layout(title = "H3K27me3 enrichment on svbF7 bound or not by Svb (Ctrl condition)")
fig2
1.2.4.4.2 Act
in H3K27me3 absent H3K27me3
in svbF7 unbound 2180 0
absent svbF7 unbound 12129 19
in H3K27me3 absent H3K27me3
in svbF7 bound 46 0
absent svbF7 bound 14263 344
pvalue_fixe = phyper(46 - 1, 45, 14653 - 45, 14309)
pvalue_nonfixe = phyper(2180 - 1, 1787, 14328 - 1787, 14328)
presence = c(46,14263)
absence = c(0,19)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K27me3_fixe = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K27me3_fixe)

presence = c(2180,12129)
absence = c(0,19)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K27me3_nonfixe = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K27me3_nonfixe)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 1

La pvalue du test de fisher pour les motifs fixé est de 1 Celle du test de fisher pour les motifs non fixé est de 0.1002134`

total_svbF7_unbound_H3K27me3 =  2180+ 0
total_svbF7_bound_H3K27me3 = 46 + 0

percent_svbf7_H3K27me3_unbound = round(100 * 2180 / total_svbF7_unbound_H3K27me3, 2 ) 
percent_svbf7_unbound_without_H3K27me3 = round(100 * 0 / total_svbF7_unbound_H3K27me3, 2 ) 

percent_svbf7_H3K27me3_bound = round(100 * 46 / total_svbF7_bound_H3K27me3, 2 ) 
percent_svbf7_bound_without_H3K27me3 = round(100 * 0 / total_svbF7_bound_H3K27me3, 2 ) 


etat_svb = c("svbF7_bound","svbF7_unbound")
H3K27me3_absent = c(percent_svbf7_bound_without_H3K27me3,percent_svbf7_unbound_without_H3K27me3)

H3K27me3_present = c(percent_svbf7_H3K27me3_bound,percent_svbf7_H3K27me3_unbound)

data_H3K27me3_act = data.frame(etat_svb,H3K27me3_absent,H3K27me3_present)
datatable(data_H3K27me3_act,rownames = F,filter = "none",colnames = c("Regions without H3K27me3","Regions with H3K27me3" ))
fig2 = plot_ly(data_H3K27me3_act, x = ~etat_svb,y = ~H3K27me3_present, type = "bar",name = "H3K27me3 present", color =I("purple"))
fig2 = fig2 %>% add_trace(y = ~H3K27me3_absent, name = "H3K27me3 absent",color = I("grey"))
fig2 = fig2 %>% layout(yaxis = list(title = "percent"))
fig2 = fig2 %>% layout(title = "H3K27me3 enrichment on svbF7 bound or not by Svb ( Act condition ) ", barmode = "stack")
fig2
fig2 = plot_ly(data_H3K27me3_act, x = ~etat_svb,y = ~H3K27me3_present, type = "bar",name = "H3K27me3 present", color =I("purple"))
fig2 = fig2 %>% add_trace(y = ~H3K27me3_absent, name = "H3K27me3 absent",color = I("grey"))
fig2 = fig2 %>% layout(yaxis = list(title = "percent"))
fig2 = fig2 %>% layout(title = "H3K27me3 enrichment on svbF7 bound or not by Svb ( Act condition ) ")
fig2
1.2.4.4.3 Rep
in H3K27me3 absent H3K27me3
in svbF7 unbound 223 0
absent svbF7 unbound 13048 0
in H3K27me3 absent H3K27me3
in svbF7 bound 48 0
absent svbF7 bound 15253 0
pvalue_fixe = phyper(48 - 1, 45, 15301 - 45, 15301)
pvalue_nonfixe = phyper(2253 - 1, 1787, 15301 - 1787, 15301)
presence = c(48,15253)
absence = c(0,0)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K27me3_fixe = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K27me3_fixe)

presence = c(223,13048)
absence = c(0,0)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K27me3_nonfixe = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K27me3_nonfixe)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 1

La pvalue du test de fisher pour les motifs fixé est de 1 Celle du test de fisher pour les motifs non fixé est de 1`

total_svbF7_unbound_H3K27me3 =  223+ 0
total_svbF7_bound_H3K27me3 = 48 + 0

percent_svbf7_H3K27me3_unbound = round(100 * 223 / total_svbF7_unbound_H3K27me3, 2 ) 
percent_svbf7_unbound_without_H3K27me3 = round(100 * 0 / total_svbF7_unbound_H3K27me3, 2 ) 

percent_svbf7_H3K27me3_bound = round(100 * 48 / total_svbF7_bound_H3K27me3, 2 ) 
percent_svbf7_bound_without_H3K27me3 = round(100 * 0 / total_svbF7_bound_H3K27me3, 2 ) 


etat_svb = c("svbF7_bound","svbF7_unbound")
H3K27me3_absent = c(percent_svbf7_bound_without_H3K27me3,percent_svbf7_unbound_without_H3K27me3)

H3K27me3_present = c(percent_svbf7_H3K27me3_bound,percent_svbf7_H3K27me3_unbound)

data_H3K27me3_rep = data.frame(etat_svb,H3K27me3_absent,H3K27me3_present)
datatable(data_H3K27me3_rep,rownames = F,filter = "none",colnames = c("Regions without H3K27me3","Regions with H3K27me3" ))
fig2 = plot_ly(data_H3K27me3_rep, x = ~etat_svb,y = ~H3K27me3_present, type = "bar",name = "H3K27me3 present", color =I("purple"))
fig2 = fig2 %>% add_trace(y = ~H3K27me3_absent, name = "H3K27me3 absent",color = I("grey"))
fig2 = fig2 %>% layout(yaxis = list(title = "percent"))
fig2 = fig2 %>% layout(title = "H3K27me3 enrichment on svbF7 bound or not by Svb ( Rep condition ) ", barmode = "stack")
fig2
fig2 = plot_ly(data_H3K27me3_rep, x = ~etat_svb,y = ~H3K27me3_present, type = "bar",name = "H3K27me3 present", color =I("purple"))
fig2 = fig2 %>% add_trace(y = ~H3K27me3_absent, name = "H3K27me3 absent",color = I("grey"))
fig2 = fig2 %>% layout(yaxis = list(title = "percent"))
fig2 = fig2 %>% layout(title = "H3K27me3 enrichment on svbF7 bound or not by Svb ( Rep condition ) ")
fig2

1.2.5 Sur les promoteurs

Je regarde ici l’enrichisement en histones des motifs de Svb en présence des différentes formes de Svb ( Act/ Rep) et Ctrl

1.2.5.1 H3K4me1

1.2.5.1.1 Ctrl
in H3K4me1 absent H3K4me1
in svbF7 unbound 1434 366
absent svbF7 unbound 8757 4425
in H3K4me1 absent H3K4me1
in svbF7 bound 48 0
absent svbF7 bound 10148 4328
pvalue_fixe = phyper(48 - 1, 30, 14524 - 30, 10196)
pvalue_nonfixe = phyper(1434 - 1, 1800, 14982 - 1800, 10191)
presence = c(48,10148)
absence = c(0,4328)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K4me1_fixe_ctrl = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K4me1_fixe_ctrl)

presence = c(1434,8757)
absence = c(366,4425)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K4me1_nonfixe_ctrl = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K4me1_nonfixe_ctrl)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 1

La pvalue du test de fisher pour les motifs fixé est de 6.868377910^{-8} Celle du test de fisher pour les motifs non fixé est de 1.65729710^{-31}`

total_svbF7_unbound = 1434 + 366
total_svbF7_bound = 48 + 0

percent_svbf7_H3K4me1_unbound = round(100 * 1434 / total_svbF7_unbound, 2 ) 
percent_svbf7_unbound_without_H3K4me1 = round(100 * 366 / total_svbF7_unbound, 2 ) 

percent_svbf7_H3K4me1_bound = round(100 * 48 / total_svbF7_bound, 2 ) 
percent_svbf7_bound_without_H3K4me1 = round(100 * 0 / total_svbF7_bound, 2 ) 



etat_svb = c("svbF7_bound","svbF7_unbound")
H3K4me1_absent = c(percent_svbf7_bound_without_H3K4me1,percent_svbf7_unbound_without_H3K4me1)

H3K4me1_present = c(percent_svbf7_H3K4me1_bound,percent_svbf7_H3K4me1_unbound)

data_H3K4me1_ctrl = data.frame(etat_svb,H3K4me1_absent,H3K4me1_present)
datatable(data_H3K4me1_ctrl,rownames = F,filter = "none", colnames = c("Regions without H3K4me1","Regions with H3K4me1" ))
fig3 = plot_ly(data_H3K4me1_ctrl, x = ~etat_svb,y = ~H3K4me1_present, type = "bar",name = "H3K4me1 present", color = I("orange"))
fig3 = fig3 %>% add_trace(y = ~H3K4me1_present, name = "H3K4me1 absent", color = I("grey"))
fig3 = fig3 %>% layout(yaxis = list(title = "percent"))
fig3 = fig3 %>% layout(title = "H3K4me1 enrichment on svbF7 bound or not by Svb (Ctrl condition)", barmode = "stack")
fig3
fig3 = plot_ly(data_H3K4me1_ctrl, x = ~etat_svb,y = ~H3K4me1_present, type = "bar",name = "H3K4me1 present", color = I("orange"))
fig3 = fig3 %>% add_trace(y = ~H3K4me1_present, name = "H3K4me1 absent", color = I("grey"))
fig3 = fig3 %>% layout(yaxis = list(title = "percent"))
fig3 = fig3 %>% layout(title = "H3K4me1 enrichment on svbF7 bound or not by Svb (Ctrl condition)")
fig3
1.2.5.1.2 Act
in H3K4me1 absent H3K4me1
in svbF7 unbound 1657 143
absent svbF7 unbound 10587 3398
in H3K4me1 absent H3K4me1
in svbF7 bound 47 0
absent svbF7 bound 12203 3028
pvalue_fixe = phyper(47 - 1, 30, 15278 - 30, 12250)
pvalue_nonfixe = phyper(1657 - 1, 1800, 15785 - 1800, 12244)
presence = c(1657,10587)
absence = c(143,3398)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K4me1_fixe_act = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K4me1_fixe_act)

presence = c(47,0)
absence = c(12203,3028)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K4me1_nonfixe_act = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K4me1_nonfixe_act)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 1

La pvalue du test de fisher pour les motifs fixé est de 1.853204510^{-66} Celle du test de fisher pour les motifs non fixé est de 5.716693710^{-5}`

total_svbF7_unbound = 1657 + 143
total_svbF7_bound = 47 + 0

percent_svbf7_H3K4me1_unbound = round(100 * 1657 / total_svbF7_unbound, 2 ) 
percent_svbf7_unbound_without_H3K4me1 = round(100 * 143 / total_svbF7_unbound, 2 ) 

percent_svbf7_H3K4me1_bound = round(100 * 47 / total_svbF7_bound, 2 ) 
percent_svbf7_bound_without_H3K4me1 = round(100 * 0 / total_svbF7_bound, 2 ) 



etat_svb = c("svbF7_bound","svbF7_unbound")
H3K4me1_absent = c(percent_svbf7_bound_without_H3K4me1,percent_svbf7_unbound_without_H3K4me1)

H3K4me1_present = c(percent_svbf7_H3K4me1_bound,percent_svbf7_H3K4me1_unbound)

data_H3K4me1_act = data.frame(etat_svb,H3K4me1_absent,H3K4me1_present)
datatable(data_H3K4me1_act,rownames = F,filter = "none", colnames = c("Regions without H3K4me1","Regions with H3K4me1" ))
fig3 = plot_ly(data_H3K4me1_act, x = ~etat_svb,y = ~H3K4me1_present, type = "bar",name = "H3K4me1 present", color = I("orange"))
fig3 = fig3 %>% add_trace(y = ~H3K4me1_absent, name = "H3K4me1 absent", color = I("grey"))
fig3 = fig3 %>% layout(yaxis = list(title = "percent"))
fig3 = fig3 %>% layout(title = "H3K4me1 enrichment on svbF7 bound or not by Svb (Act condition)", barmode = "stack")
fig3
fig3 = plot_ly(data_H3K4me1_act, x = ~etat_svb,y = ~H3K4me1_present, type = "bar",name = "H3K4me1 present", color = I("orange"))
fig3 = fig3 %>% add_trace(y = ~H3K4me1_absent, name = "H3K4me1 absent", color = I("grey"))
fig3 = fig3 %>% layout(yaxis = list(title = "percent"))
fig3 = fig3 %>% layout(title = "H3K4me1 enrichment on svbF7 bound or not by Svb (Act condition)")
fig3
1.2.5.1.3 Rep
in H3K4me1 absent H3K4me1
in svbF7 unbound 1580 220
absent svbF7 unbound 10217 3582
in H3K4me1 absent H3K4me1
in svbF7 bound 46 0
absent svbF7 bound 11756 3301
pvalue_fixe = phyper(46 - 1, 30, 15103 - 30, 11802)
pvalue_nonfixe = phyper(1508 - 1, 1800, 15599 - 1800, 11797)
presence = c(46,11756)
absence = c(0,3301)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K4me1_fixe_rep = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K4me1_fixe_rep)

presence = c(1580,10217)
absence = c(220,3582)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K4me1_nonfixe_rep = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K4me1_nonfixe_rep)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 1

La pvalue du test de fisher pour les motifs fixé est de 1.783063810^{-5} Celle du test de fisher pour les motifs non fixé est de 4.847625110^{-42}`

total_svbF7_unbound = 1580 + 220
total_svbF7_bound = 46 + 0

percent_svbf7_H3K4me1_unbound = round(100 * 1580 / total_svbF7_unbound, 2 ) 
percent_svbf7_unbound_without_H3K4me1 = round(100 * 220 / total_svbF7_unbound, 2 ) 

percent_svbf7_H3K4me1_bound = round(100 * 46 / total_svbF7_bound, 2 ) 
percent_svbf7_bound_without_H3K4me1 = round(100 * 0 / total_svbF7_bound, 2 ) 



etat_svb = c("svbF7_bound","svbF7_unbound")
H3K4me1_absent = c(percent_svbf7_bound_without_H3K4me1,percent_svbf7_unbound_without_H3K4me1)

H3K4me1_present = c(percent_svbf7_H3K4me1_bound,percent_svbf7_H3K4me1_unbound)

data_H3K4me1_rep = data.frame(etat_svb,H3K4me1_absent,H3K4me1_present)
datatable(data_H3K4me1_rep,rownames = F,filter = "none", colnames = c("Regions without H3K4me1","Regions with H3K4me1" ))
fig3 = plot_ly(data_H3K4me1_rep, x = ~etat_svb,y = ~H3K4me1_present, type = "bar",name = "H3K4me1 present", color = I("orange"))
fig3 = fig3 %>% add_trace(y = ~H3K4me1_absent, name = "H3K4me1 absent", color = I("grey"))
fig3 = fig3 %>% layout(yaxis = list(title = "percent"))
fig3 = fig3 %>% layout(title = "H3K4me1 enrichment on svbF7 bound or not by Svb (Rep condition)", barmode = "stack")
fig3
fig3 = plot_ly(data_H3K4me1_rep, x = ~etat_svb,y = ~H3K4me1_present, type = "bar",name = "H3K4me1 present", color = I("orange"))
fig3 = fig3 %>% add_trace(y = ~H3K4me1_absent, name = "H3K4me1 absent", color = I("grey"))
fig3 = fig3 %>% layout(yaxis = list(title = "percent"))
fig3 = fig3 %>% layout(title = "H3K4me1 enrichment on svbF7 bound or not by Svb (Rep condition)")
fig3

1.2.5.2 H3K4me3

1.2.5.2.1 Ctrl
in H3K4me3 absent H3K4me3
in svbF7 unbound 1087 713
absent svbF7 unbound 9558 6543
in H3K4me3 absent H3K4me3
in svbF7 bound 31 0
absent svbF7 bound 10614 6606
pvalue_fixe = phyper(31 - 1, 30, 17251 - 30, 10645)
pvalue_nonfixe = phyper(1087 - 1, 1800, 17901 - 1800, 10645)
presence = c(31,10614)
absence = c(0,6606)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K4me3_fixe_ctrl = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K4me3_fixe_ctrl)

presence = c(1087,9558)
absence = c(713,6543)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K4me3_nonfixe_ctrl = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K4me3_nonfixe_ctrl)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 0.7925253

La pvalue du test de fisher pour les motifs fixé est de 5.534338610^{-7} Celle du test de fisher pour les motifs non fixé est de 0.4037`

total_svbF7_unbound_H3K4me3 = 1087 + 713
total_svbF7_bound_H3K4me3 = 31 + 0

percent_svbf7_H3K4me3_unbound = round(100 * 1087 / total_svbF7_unbound_H3K4me3, 2 ) 
percent_svbf7_unbound_without_H3K4me3 = round(100 * 713 / total_svbF7_unbound_H3K4me3, 2 ) 

percent_svbf7_H3K4me3_bound = round(100 * 31 / total_svbF7_bound_H3K4me3, 2 ) 
percent_svbf7_bound_without_H3K4me3 = round(100 * 0 / total_svbF7_bound_H3K4me3, 2 ) 



etat_svb = c("svbF7_bound","svbF7_unbound")
H3K4me3_absent = c(percent_svbf7_bound_without_H3K4me3,percent_svbf7_unbound_without_H3K4me3)

H3K4me3_present = c(percent_svbf7_H3K4me3_bound,percent_svbf7_H3K4me3_unbound)

data_H3K4me3_ctrl = data.frame(etat_svb,H3K4me3_absent,H3K4me3_present)
datatable(data_H3K4me3_ctrl,rownames = F,filter = "none",colnames = c("Regions without H3K4me3","Regions with H3K4me3" ))
fig4 = plot_ly(data_H3K4me3_ctrl, x = ~etat_svb,y = ~H3K4me3_present, type = "bar",name = "H3K4me3 present", color = I("pink"))
fig4 = fig4 %>% add_trace(y = ~H3K4me3_absent, name = "H3K4me3 absent", color = I("grey"))
fig4 = fig4 %>% layout(yaxis = list(title = "percent"))
fig4 = fig4 %>% layout(title = "H3K4me3 enrichment on svbF7 bound or not by Svb (Ctrl condition)", barmode = "stack")
fig4
fig4 = plot_ly(data_H3K4me3_ctrl, x = ~etat_svb,y = ~H3K4me3_present, type = "bar",name = "H3K4me3 present", color = I("pink"))
fig4 = fig4 %>% add_trace(y = ~H3K4me3_absent, name = "H3K4me3 absent", color = I("grey"))
fig4 = fig4 %>% layout(yaxis = list(title = "percent"))
fig4 = fig4 %>% layout(title = "H3K4me3 enrichment on svbF7 bound or not by Svb (Ctrl condition)")
fig4
1.2.5.2.2 Act
in H3K4me3 absent H3K4me3
in svbF7 unbound 646 1154
absent svbF7 unbound 6593 9601
in H3K4me3 absent H3K4me3
in svbF7 bound 28 2
absent svbF7 bound 7212 10096
pvalue_fixe = phyper(28 - 1, 30, 17338 - 30, 7240)
pvalue_nonfixe = phyper(646 - 1, 1800, 17994 - 1800, 7239)
presence = c(28,7212)
absence = c(2,10096)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K4me3_fixe_act = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K4me3_fixe_act)

presence = c(646,6593)
absence = c(2,10096)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K4me3_nonfixe_act = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K4me3_nonfixe_act)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 3.076336810^{-5}

La pvalue du test de fisher pour les motifs fixé est de 3.624050310^{-9} Celle du test de fisher pour les motifs non fixé est de 1.811466310^{-248}`

total_svbF7_unbound_H3K4me3 = 646 + 1154
total_svbF7_bound_H3K4me3 = 28 + 2

percent_svbf7_H3K4me3_unbound = round(100 * 646 / total_svbF7_unbound_H3K4me3, 2 ) 
percent_svbf7_unbound_without_H3K4me3 = round(100 * 1154 / total_svbF7_unbound_H3K4me3, 2 ) 

percent_svbf7_H3K4me3_bound = round(100 * 28 / total_svbF7_bound_H3K4me3, 2 ) 
percent_svbf7_bound_without_H3K4me3 = round(100 * 2/ total_svbF7_bound_H3K4me3, 2 ) 



etat_svb = c("svbF7_bound","svbF7_unbound")
H3K4me3_absent = c(percent_svbf7_bound_without_H3K4me3,percent_svbf7_unbound_without_H3K4me3)

H3K4me3_present = c(percent_svbf7_H3K4me3_bound,percent_svbf7_H3K4me3_unbound)

data_H3K4me3_act = data.frame(etat_svb,H3K4me3_absent,H3K4me3_present)
datatable(data_H3K4me3_act,rownames = F,filter = "none",colnames = c("Regions without H3K4me3","Regions with H3K4me3" ))
fig4 = plot_ly(data_H3K4me3_act, x = ~etat_svb,y = ~H3K4me3_present, type = "bar",name = "H3K4me3 present", color = I("pink"))
fig4 = fig4 %>% add_trace(y = ~H3K4me3_absent, name = "H3K4me3 absent", color = I("grey"))
fig4 = fig4 %>% layout(yaxis = list(title = "percent"))
fig4 = fig4 %>% layout(title = "H3K4me3 enrichment on svbF7 bound or not by Svb (Act condition)", barmode = "stack")
fig4
fig4 = plot_ly(data_H3K4me3_act, x = ~etat_svb,y = ~H3K4me3_present, type = "bar",name = "H3K4me3 present", color = I("pink"))
fig4 = fig4 %>% add_trace(y = ~H3K4me3_absent, name = "H3K4me3 absent", color = I("grey"))
fig4 = fig4 %>% layout(yaxis = list(title = "percent"))
fig4 = fig4 %>% layout(title = "H3K4me3 enrichment on svbF7 bound or not by Svb (Act condition)")
fig4
1.2.5.2.3 Rep
in H3K4me3 absent H3K4me3
in svbF7 unbound 444 1356
absent svbF7 unbound 4350 10691
in H3K4me3 absent H3K4me3
in svbF7 bound 28 2
absent svbF7 bound 4764 11467
pvalue_fixe = phyper(28 - 1, 30, 16264 - 30, 4795)
pvalue_nonfixe = phyper(444 - 1, 1800, 16841 - 1800, 4794)
presence = c(444,4350)
absence = c(1356,10691)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K4me3_fixe_rep = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K4me3_fixe_rep)

presence = c(28,2)
absence = c(4764,11467)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K4me3_nonfixe_rep = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K4me3_nonfixe_rep)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 5.822629410^{-5}

La pvalue du test de fisher pour les motifs fixé est de 1.362101910^{-4} Celle du test de fisher pour les motifs non fixé est de 2.932863510^{-13}`

total_svbF7_unbound_H3K4me3 = 444 + 1356
total_svbF7_bound_H3K4me3 = 28 + 2

percent_svbf7_H3K4me3_unbound = round(100 * 444 / total_svbF7_unbound_H3K4me3, 2 ) 
percent_svbf7_unbound_without_H3K4me3 = round(100 * 1356 / total_svbF7_unbound_H3K4me3, 2 ) 

percent_svbf7_H3K4me3_bound = round(100 * 28 / total_svbF7_bound_H3K4me3, 2 ) 
percent_svbf7_bound_without_H3K4me3 = round(100 * 2 / total_svbF7_bound_H3K4me3, 2 ) 



etat_svb = c("svbF7_bound","svbF7_unbound")
H3K4me3_absent = c(percent_svbf7_bound_without_H3K4me3,percent_svbf7_unbound_without_H3K4me3)

H3K4me3_present = c(percent_svbf7_H3K4me3_bound,percent_svbf7_H3K4me3_unbound)

data_H3K4me3_rep = data.frame(etat_svb,H3K4me3_absent,H3K4me3_present)
datatable(data_H3K4me3_rep,rownames = F,filter = "none",colnames = c("Regions without H3K4me3","Regions with H3K4me3" ))
fig4 = plot_ly(data_H3K4me3_rep, x = ~etat_svb,y = ~H3K4me3_present, type = "bar",name = "H3K4me3 present", color = I("pink"))
fig4 = fig4 %>% add_trace(y = ~H3K4me3_absent, name = "H3K4me3 absent", color = I("grey"))
fig4 = fig4 %>% layout(yaxis = list(title = "percent"))
fig4 = fig4 %>% layout(title = "H3K4me3 enrichment on svbF7 bound or not by Svb (Rep condition)", barmode = "stack")
fig4
fig4 = plot_ly(data_H3K4me3_rep, x = ~etat_svb,y = ~H3K4me3_present, type = "bar",name = "H3K4me3 present", color = I("pink"))
fig4 = fig4 %>% add_trace(y = ~H3K4me3_absent, name = "H3K4me3 absent", color = I("grey"))
fig4 = fig4 %>% layout(yaxis = list(title = "percent"))
fig4 = fig4 %>% layout(title = "H3K4me3 enrichment on svbF7 bound or not by Svb (Rep condition)")
fig4
1.2.5.2.4 Rapport K4me1/ K4me3
1.2.5.2.4.1 Ctrl
total_K4me1_S2 = 8782
total_K4me3_S2 = 4812
rapp_fixe = round((contingence_H3K4me1_fixe_ctrl[1,1] / total_K4me1_S2 ) / (contingence_H3K4me3_fixe_ctrl[1,1] / total_K4me3_S2),2)
rapp_nonfixe = round((contingence_H3K4me1_nonfixe_ctrl[1,1] / total_K4me1_S2)  / (contingence_H3K4me3_nonfixe_ctrl[1,1] / total_K4me3_S2) ,2)

Il y a 0.85 fois de H3K4me1 que de H3K4me3 fixé.

Il y a 0.72 fois de H3K4me1 que de H3K4me3 non fixé.

1.2.5.2.4.2 Act
total_K4me1_S2 = 8782
total_K4me3_S2 = 4812
rapp_fixe = round((contingence_H3K4me1_fixe_act [1,1] / total_K4me1_S2 ) / (contingence_H3K4me3_fixe_act[1,1] / total_K4me3_S2),2)
rapp_nonfixe = round((contingence_H3K4me1_nonfixe_act[1,1] / total_K4me1_S2)  / (contingence_H3K4me3_nonfixe_act[1,1] / total_K4me3_S2) ,2)

Il y a 32.43 fois de H3K4me1 que de H3K4me3 fixé.

Il y a 0.04 fois de H3K4me1 que de H3K4me3 non fixé.

1.2.5.2.4.3 Rep
total_K4me1_S2 = 8782
total_K4me3_S2 = 4812
rapp_fixe = round((contingence_H3K4me1_fixe_rep[1,1] / total_K4me1_S2 ) / (contingence_H3K4me3_fixe_rep[1,1] / total_K4me3_S2),2)
rapp_nonfixe = round((contingence_H3K4me1_nonfixe_rep[1,1] / total_K4me1_S2)  / (contingence_H3K4me3_nonfixe_rep[1,1] / total_K4me3_S2) ,2)

1.2.5.3 H3K27ac

1.2.5.3.1 Ctrl
in H3K27ac absent H3K27ac
in svbF7 unbound 612 1188
absent svbF7 unbound 5020 8887
in H3K27ac absent H3K27ac
in svbF7 bound 34 0
absent svbF7 bound 5601 9570
pvalue_fixe = phyper(34 - 1, 30, 15205 - 30, 5635)
pvalue_nonfixe = phyper(612 - 1, 1800, 15707 - 1800, 5632)
presence = c(34,5601)
absence = c(0,9570)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K27ac_fixe = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K27ac_fixe)

presence = c(612,5020)
absence = c(1188,8887)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K27ac_nonfixe = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K27ac_nonfixe)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 0.0378741

La pvalue du test de fisher pour les motifs fixé est de 2.068081110^{-15} Celle du test de fisher pour les motifs non fixé est de 0.0847469`

total_svbF7_unbound_H3K27ac = 612 + 1188
total_svbF7_bound_H3K27ac = 34 + 0

percent_svbf7_H3K27ac_unbound = round(100 * 612 / total_svbF7_unbound_H3K27ac, 2 ) 
percent_svbf7_unbound_without_H3K27ac = round(100 * 1188 / total_svbF7_unbound_H3K27ac, 2 ) 

percent_svbf7_H3K27ac_bound = round(100 * 34 / total_svbF7_bound_H3K27ac, 2 ) 
percent_svbf7_bound_without_H3K27ac = round(100 * 0 / total_svbF7_bound_H3K27ac, 2 ) 


etat_svb = c("svbF7_bound","svb_unbound")
H3K27ac_absent = c(percent_svbf7_bound_without_H3K27ac,percent_svbf7_unbound_without_H3K27ac)

H3K27ac_present = c(percent_svbf7_H3K27ac_bound,percent_svbf7_H3K27ac_unbound)

data_H3K27ac_ctrl = data.frame(etat_svb,H3K27ac_absent,H3K27ac_present)
datatable(data_H3K27ac_ctrl,rownames = F,filter = "none",colnames = c("Regions without H3K27ac","Regions with H3K27ac" ))
fig1 = plot_ly(data_H3K27ac_ctrl, x = ~etat_svb,y = ~H3K27ac_present, type = "bar",name = "H3K27ac present", color = I("blue"))
fig1 = fig1 %>% add_trace(y = ~H3K27ac_absent, name = "H3K27ac absent", color = I("grey"))
fig1 = fig1 %>% layout(yaxis = list(title = "percent"))
fig1 = fig1 %>% layout(title = "H3K27ac enrichment on svbF7 bound or not by Svb ( Ctrl condition)", barmode = "stack")
fig1
fig1 = plot_ly(data_H3K27ac_ctrl, x = ~etat_svb,y = ~H3K27ac_present, type = "bar",name = "H3K27ac present", color = I("blue"))
fig1 = fig1 %>% add_trace(y = ~H3K27ac_absent, name = "H3K27ac absent", color = I("grey"))
fig1 = fig1 %>% layout(yaxis = list(title = "percent"))
fig1 = fig1 %>% layout(title = "H3K27ac enrichment on svbF7 bound or not by Svb ( Ctrl condition)")
fig1
1.2.5.3.2 Act
in H3K27ac absent H3K27ac
in svbF7 unbound 606 1194
absent svbF7 unbound 5072 8991
in H3K27ac absent H3K27ac
in svbF7 bound 35 0
absent svbF7 bound 5646 9670
pvalue_fixe = phyper(35 - 1, 30, 15351 - 30, 5681)
pvalue_nonfixe = phyper(606 - 1, 1800, 15863 - 1800, 5678)
presence = c(35,5646)
absence = c(0,9670)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K27ac_fixe = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K27ac_fixe)

presence = c(606,5072)
absence = c(1194,8991)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K27ac_nonfixe = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K27ac_nonfixe)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 0.021082

La pvalue du test de fisher pour les motifs fixé est de 7.26694110^{-16} Celle du test de fisher pour les motifs non fixé est de 0.0472022`

total_svbF7_unbound_H3K27ac = 606 + 1194
total_svbF7_bound_H3K27ac = 35 + 0

percent_svbf7_H3K27ac_unbound = round(100 * 606 / total_svbF7_unbound_H3K27ac, 2 ) 
percent_svbf7_unbound_without_H3K27ac = round(100 * 1194 / total_svbF7_unbound_H3K27ac, 2 ) 

percent_svbf7_H3K27ac_bound = round(100 * 35 / total_svbF7_bound_H3K27ac, 2 ) 
percent_svbf7_bound_without_H3K27ac = round(100 * 0 / total_svbF7_bound_H3K27ac, 2 ) 


etat_svb = c("svbF7_bound","svb_unbound")
H3K27ac_absent = c(percent_svbf7_bound_without_H3K27ac,percent_svbf7_unbound_without_H3K27ac)

H3K27ac_present = c(percent_svbf7_H3K27ac_bound,percent_svbf7_H3K27ac_unbound)

data_H3K27ac_act = data.frame(etat_svb,H3K27ac_absent,H3K27ac_present)
datatable(data_H3K27ac_act,rownames = F,filter = "none",colnames = c("Regions without H3K27ac","Regions with H3K27ac" ))
fig1 = plot_ly(data_H3K27ac_act, x = ~etat_svb,y = ~H3K27ac_present, type = "bar",name = "H3K27ac present", color = I("blue"))
fig1 = fig1 %>% add_trace(y = ~H3K27ac_absent, name = "H3K27ac absent", color = I("grey"))
fig1 = fig1 %>% layout(yaxis = list(title = "percent"))
fig1 = fig1 %>% layout(title = "H3K27ac enrichment on svbF7 bound or not by Svb ( Act Condtion) ", barmode = "stack")
fig1
fig1 = plot_ly(data_H3K27ac_act, x = ~etat_svb,y = ~H3K27ac_present, type = "bar",name = "H3K27ac present", color = I("blue"))
fig1 = fig1 %>% add_trace(y = ~H3K27ac_absent, name = "H3K27ac absent", color = I("grey"))
fig1 = fig1 %>% layout(yaxis = list(title = "percent"))
fig1 = fig1 %>% layout(title = "H3K27ac enrichment on svbF7 bound or not by Svb ( Act Condtion) ")
fig1
1.2.5.3.3 Rep
in H3K27ac absent H3K27ac
in svbF7 unbound 602 1198
absent svbF7 unbound 5030 8898
in H3K27ac absent H3K27ac
in svbF7 bound 31 0
absent svbF7 bound 5603 9590
pvalue_fixe = phyper(31 - 1, 30, 15224 - 30, 5634)
pvalue_nonfixe = phyper(602 - 1, 1800, 15728 - 1800, 5632)
presence = c(31,5603)
absence = c(0,9590)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K27ac_fixe = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K27ac_fixe)

presence = c(602,5030)
absence = c(1198,8898)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K27ac_nonfixe = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K27ac_nonfixe)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 0.0119846

La pvalue du test de fisher pour les motifs fixé est de 3.929115610^{-14} Celle du test de fisher pour les motifs non fixé est de 0.0264009`

total_svbF7_unbound_H3K27ac = 602 + 1198
total_svbF7_bound_H3K27ac = 31 + 0

percent_svbf7_H3K27ac_unbound = round(100 * 602 / total_svbF7_unbound_H3K27ac, 2 ) 
percent_svbf7_unbound_without_H3K27ac = round(100 * 1198 / total_svbF7_unbound_H3K27ac, 2 ) 

percent_svbf7_H3K27ac_bound = round(100 * 31 / total_svbF7_bound_H3K27ac, 2 ) 
percent_svbf7_bound_without_H3K27ac = round(100 * 0 / total_svbF7_bound_H3K27ac, 2 ) 


etat_svb = c("svbF7_bound","svb_unbound")
H3K27ac_absent = c(percent_svbf7_bound_without_H3K27ac,percent_svbf7_unbound_without_H3K27ac)

H3K27ac_present = c(percent_svbf7_H3K27ac_bound,percent_svbf7_H3K27ac_unbound)

data_H3K27ac_rep = data.frame(etat_svb,H3K27ac_absent,H3K27ac_present)
datatable(data_H3K27ac_rep,rownames = F,filter = "none",colnames = c("Regions without H3K27ac","Regions with H3K27ac" ))
fig1 = plot_ly(data_H3K27ac_rep, x = ~etat_svb,y = ~H3K27ac_present, type = "bar",name = "H3K27ac present", color = I("blue"))
fig1 = fig1 %>% add_trace(y = ~H3K27ac_absent, name = "H3K27ac absent", color = I("grey"))
fig1 = fig1 %>% layout(yaxis = list(title = "percent"))
fig1 = fig1 %>% layout(title = "H3K27ac enrichment on svbF7 bound or not by Svb ( Rep condition) ", barmode = "stack")
fig1
fig1 = plot_ly(data_H3K27ac_rep, x = ~etat_svb,y = ~H3K27ac_present, type = "bar",name = "H3K27ac present", color = I("blue"))
fig1 = fig1 %>% add_trace(y = ~H3K27ac_absent, name = "H3K27ac absent", color = I("grey"))
fig1 = fig1 %>% layout(yaxis = list(title = "percent"))
fig1 = fig1 %>% layout(title = "H3K27ac enrichment on svbF7 bound or not by Svb ( Rep condition) ")
fig1

1.2.5.4 H3K27me3

1.2.5.4.1 Ctrl
in H3K27me3 absent H3K27me3
in svbF7 unbound 2278 0
absent svbF7 unbound 12849 0
in H3K27me3 absent H3K27me3
in svbF7 bound 33 0
absent svbF7 bound 15094 0
pvalue_fixe = phyper(33 - 1, 30, 15127 - 30, 15127)
pvalue_nonfixe = phyper(2278 - 1, 1800, 15127 - 1800, 15127)
presence = c(33,15094)
absence = c(0,0)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K27me3_fixe = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K27me3_fixe)

presence = c(2278,15094)
absence = c(0,0)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K27me3_nonfixe = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K27me3_nonfixe)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 1

La pvalue du test de fisher pour les motifs fixé est de 1 Celle du test de fisher pour les motifs non fixé est de 1`

total_svbF7_unbound_H3K27me3 = 2278 + 0
total_svbF7_bound_H3K27me3 = 33 + 0

percent_svbf7_H3K27me3_unbound = round(100 * 2278 / total_svbF7_unbound_H3K27me3, 2 ) 
percent_svbf7_unbound_without_H3K27me3 = round(100 * 0 / total_svbF7_unbound_H3K27me3, 2 ) 

percent_svbf7_H3K27me3_bound = round(100 * 33 / total_svbF7_bound_H3K27me3, 2 ) 
percent_svbf7_bound_without_H3K27me3 = round(100 * 0 / total_svbF7_bound_H3K27me3, 2 ) 


etat_svb = c("svbF7_bound","svbF7_unbound")
H3K27me3_absent = c(percent_svbf7_bound_without_H3K27me3,percent_svbf7_unbound_without_H3K27me3)

H3K27me3_present = c(percent_svbf7_H3K27me3_bound,percent_svbf7_H3K27me3_unbound)

data_H3K27me3_ctrl = data.frame(etat_svb,H3K27me3_absent,H3K27me3_present)
datatable(data_H3K27me3_ctrl,rownames = F,filter = "none",colnames = c("Regions without H3K27me3","Regions with H3K27me3" ))
fig2 = plot_ly(data_H3K27me3_ctrl, x = ~etat_svb,y = ~H3K27me3_present, type = "bar",name = "H3K27me3 present", color =I("purple"))
fig2 = fig2 %>% add_trace(y = ~H3K27me3_absent, name = "H3K27me3 absent",color = I("grey"))
fig2 = fig2 %>% layout(yaxis = list(title = "percent"))
fig2 = fig2 %>% layout(title = "H3K27me3 enrichment on svbF7 bound or not by Svb (Ctrl condition)", barmode = "stack")
fig2
fig2 = plot_ly(data_H3K27me3_ctrl, x = ~etat_svb,y = ~H3K27me3_present, type = "bar",name = "H3K27me3 present", color =I("purple"))
fig2 = fig2 %>% add_trace(y = ~H3K27me3_absent, name = "H3K27me3 absent",color = I("grey"))
fig2 = fig2 %>% layout(yaxis = list(title = "percent"))
fig2 = fig2 %>% layout(title = "H3K27me3 enrichment on svbF7 bound or not by Svb (Ctrl condition)")
fig2
1.2.5.4.2 Act
in H3K27me3 absent H3K27me3
in svbF7 unbound 2192 0
absent svbF7 unbound 12117 0
in H3K27me3 absent H3K27me3
in svbF7 bound 35 0
absent svbF7 bound 14274 0
pvalue_fixe = phyper(35 - 1, 30, 14309 - 30, 14309)
pvalue_nonfixe = phyper(2192 - 1, 1800, 14329 - 1800, 14309)
presence = c(35,14274)
absence = c(0,0)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K27me3_fixe = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K27me3_fixe)

presence = c(2192,14274)
absence = c(0,0)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K27me3_nonfixe = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K27me3_nonfixe)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 1

La pvalue du test de fisher pour les motifs fixé est de 1 Celle du test de fisher pour les motifs non fixé est de 1`

total_svbF7_unbound_H3K27me3 =  2192+ 0
total_svbF7_bound_H3K27me3 = 35 + 0

percent_svbf7_H3K27me3_unbound = round(100 * 2192 / total_svbF7_unbound_H3K27me3, 2 ) 
percent_svbf7_unbound_without_H3K27me3 = round(100 * 0 / total_svbF7_unbound_H3K27me3, 2 ) 

percent_svbf7_H3K27me3_bound = round(100 * 35 / total_svbF7_bound_H3K27me3, 2 ) 
percent_svbf7_bound_without_H3K27me3 = round(100 * 0 / total_svbF7_bound_H3K27me3, 2 ) 


etat_svb = c("svbF7_bound","svbF7_unbound")
H3K27me3_absent = c(percent_svbf7_bound_without_H3K27me3,percent_svbf7_unbound_without_H3K27me3)

H3K27me3_present = c(percent_svbf7_H3K27me3_bound,percent_svbf7_H3K27me3_unbound)

data_H3K27me3_act = data.frame(etat_svb,H3K27me3_absent,H3K27me3_present)
datatable(data_H3K27me3_act,rownames = F,filter = "none",colnames = c("Regions without H3K27me3","Regions with H3K27me3" ))
fig2 = plot_ly(data_H3K27me3_act, x = ~etat_svb,y = ~H3K27me3_present, type = "bar",name = "H3K27me3 present", color =I("purple"))
fig2 = fig2 %>% add_trace(y = ~H3K27me3_absent, name = "H3K27me3 absent",color = I("grey"))
fig2 = fig2 %>% layout(yaxis = list(title = "percent"))
fig2 = fig2 %>% layout(title = "H3K27me3 enrichment on svbF7 bound or not by Svb ( Act condition ) ", barmode = "stack")
fig2
fig2 = plot_ly(data_H3K27me3_act, x = ~etat_svb,y = ~H3K27me3_present, type = "bar",name = "H3K27me3 present", color =I("purple"))
fig2 = fig2 %>% add_trace(y = ~H3K27me3_absent, name = "H3K27me3 absent",color = I("grey"))
fig2 = fig2 %>% layout(yaxis = list(title = "percent"))
fig2 = fig2 %>% layout(title = "H3K27me3 enrichment on svbF7 bound or not by Svb ( Act condition ) ")
fig2
1.2.5.4.3 Rep
in H3K27me3 absent H3K27me3
in svbF7 unbound 2265 0
absent svbF7 unbound 13036 0
in H3K27me3 absent H3K27me3
in svbF7 bound 35 0
absent svbF7 bound 15266 0
pvalue_fixe = phyper(35 - 1, 30, 15301 - 30, 15301)
pvalue_nonfixe = phyper(2265 - 1, 1800, 15301 - 1800, 15301)
presence = c(35,15266)
absence = c(0,0)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K27me3_fixe = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K27me3_fixe)

presence = c(2265,13036)
absence = c(0,0)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K27me3_nonfixe = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K27me3_nonfixe)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 1

La pvalue du test de fisher pour les motifs fixé est de 1 Celle du test de fisher pour les motifs non fixé est de 1`

total_svbF7_unbound_H3K27me3 =  2265+ 0
total_svbF7_bound_H3K27me3 = 35 + 0

percent_svbf7_H3K27me3_unbound = round(100 * 2265 / total_svbF7_unbound_H3K27me3, 2 ) 
percent_svbf7_unbound_without_H3K27me3 = round(100 * 0 / total_svbF7_unbound_H3K27me3, 2 ) 

percent_svbf7_H3K27me3_bound = round(100 * 35 / total_svbF7_bound_H3K27me3, 2 ) 
percent_svbf7_bound_without_H3K27me3 = round(100 * 0 / total_svbF7_bound_H3K27me3, 2 ) 


etat_svb = c("svbF7_bound","svbF7_unbound")
H3K27me3_absent = c(percent_svbf7_bound_without_H3K27me3,percent_svbf7_unbound_without_H3K27me3)

H3K27me3_present = c(percent_svbf7_H3K27me3_bound,percent_svbf7_H3K27me3_unbound)

data_H3K27me3_rep = data.frame(etat_svb,H3K27me3_absent,H3K27me3_present)
datatable(data_H3K27me3_rep,rownames = F,filter = "none",colnames = c("Regions without H3K27me3","Regions with H3K27me3" ))
fig2 = plot_ly(data_H3K27me3_rep, x = ~etat_svb,y = ~H3K27me3_present, type = "bar",name = "H3K27me3 present", color =I("purple"))
fig2 = fig2 %>% add_trace(y = ~H3K27me3_absent, name = "H3K27me3 absent",color = I("grey"))
fig2 = fig2 %>% layout(yaxis = list(title = "percent"))
fig2 = fig2 %>% layout(title = "H3K27me3 enrichment on svbF7 bound or not by Svb ( Rep condition ) ", barmode = "stack")
fig2
fig2 = plot_ly(data_H3K27me3_rep, x = ~etat_svb,y = ~H3K27me3_present, type = "bar",name = "H3K27me3 present", color =I("purple"))
fig2 = fig2 %>% add_trace(y = ~H3K27me3_absent, name = "H3K27me3 absent",color = I("grey"))
fig2 = fig2 %>% layout(yaxis = list(title = "percent"))
fig2 = fig2 %>% layout(title = "H3K27me3 enrichment on svbF7 bound or not by Svb ( Rep condition ) ")
fig2

1.2.6 Comparaison entre les histones

data = merge(data_H3K4me1_ctrl,data_H3K4me1_act, by = "etat_svb" )
data = merge(data,data_H3K4me1_rep,by = "etat_svb")
data = merge(data,data_H3K4me3_ctrl, by = "etat_svb")
data = merge(data, data_H3K4me3_act, by = "etat_svb")
data = merge(data, data_H3K4me3_rep, by = "etat_svb")


data = merge(data, data_H3K27ac_ctrl, by = "etat_svb")
data = merge(data, data_H3K27ac_act, by = "etat_svb")
data = merge(data, data_H3K27ac_rep, by = "etat_svb")
data = merge(data, data_H3K27me3_ctrl, by = "etat_svb")
data = merge(data, data_H3K27me3_act, by = "etat_svb")
data = merge(data, data_H3K27me3_rep, by = "etat_svb")

1.2.7 Embryon

1.2.7.1 H3K27me3

1.2.7.1.1 8-12h
in H3K27me3 absent H3K27me3
in svbF7 unbound 695 428
absent svbF7 unbound 6067 12192
in H3K27me3 absent H3K27me3
in svbF7 bound 504 285
absent svbF7 bound 6258 11859
pvalue_fixe = phyper(504 - 1, 789, 18906 - 789, 6762)
pvalue_nonfixe = phyper(695 - 1, 1123, 19382 - 1123, 6762)
presence = c(504,6258)
absence = c(285,11859)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K27me3_fixe = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K27me3_fixe)

presence = c(695,6067)
absence = c(428,12192)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K27me3_nonfixe = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K27me3_nonfixe)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 1

La pvalue du test de fisher pour les motifs fixé est de 3.027742410^{-60} Celle du test de fisher pour les motifs non fixé est de 3.396497310^{-80}`

total_svbF7_unbound_H3K27me3 = 695 + 428
total_svbF7_bound_H3K27me3 = 504 + 285

percent_svbf7_H3K27me3_unbound = round(100 * 695 / total_svbF7_unbound_H3K27me3, 2 ) 
percent_svbf7_unbound_without_H3K27me3 = round(100 * 428 / total_svbF7_unbound_H3K27me3, 2 ) 

percent_svbf7_H3K27me3_bound = round(100 * 504 / total_svbF7_bound_H3K27me3, 2 ) 
percent_svbf7_bound_without_H3K27me3 = round(100 * 285 / total_svbF7_bound_H3K27me3, 2 ) 


etat_svb = c("svbF7_bound","svbF7_unbound")
H3K27me3_absent = c(percent_svbf7_bound_without_H3K27me3,percent_svbf7_unbound_without_H3K27me3)

H3K27me3_present = c(percent_svbf7_H3K27me3_bound,percent_svbf7_H3K27me3_unbound)

data_H3K27me3 = data.frame(etat_svb,H3K27me3_absent,H3K27me3_present)
datatable(data_H3K27me3,rownames = F,filter = "none",colnames = c("Regions without H3K27me3","Regions with H3K27me3" ))
fig2 = plot_ly(data_H3K27me3, x = ~etat_svb,y = ~H3K27me3_present, type = "bar",name = "H3K27me3 present", color = I("orange"))
fig2 = fig2 %>% add_trace(y = ~H3K27me3_absent, name = "H3K27me3 absent", color = I("grey"))
fig2 = fig2 %>% layout(yaxis = list(title = "percent"))
fig2 = fig2 %>% layout(title = "H3K27me3 ( embryo 8-12h) enrichment on svbF7 bound or not by Svb", barmode = "stack")
fig2
fig2 = plot_ly(data_H3K27me3, x = ~etat_svb,y = ~H3K27me3_present, type = "bar",name = "H3K27me3 present", color = I("orange"))
fig2 = fig2 %>% add_trace(y = ~H3K27me3_absent, name = "H3K27me3 absent", color = I("grey"))
fig2 = fig2 %>% layout(yaxis = list(title = "percent"))
fig2 = fig2 %>% layout(title = "H3K27me3 ( embryo 8-12h) enrichment on svbF7 bound or not by Svb")
fig2
1.2.7.1.2 12-16h
in H3K27me3 absent H3K27me3
in svbF7 unbound 689 434
absent svbF7 unbound 5917 12139
in H3K27me3 absent H3K27me3
in svbF7 bound 487 302
absent svbF7 bound 6119 11804
pvalue_fixe = phyper(487 - 1, 789, 18712 - 789, 6606)
pvalue_nonfixe = phyper(689 - 1, 1123, 19179 - 1123, 6606)
presence = c(487,6119)
absence = c(302,11804)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K27me3_fixe = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K27me3_fixe)

presence = c(689,5917)
absence = c(434,12139)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K27me3_nonfixe = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K27me3_nonfixe)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 1

La pvalue du test de fisher pour les motifs fixé est de 1.816562810^{-53} Celle du test de fisher pour les motifs non fixé est de 4.020798110^{-80}`

total_svbF7_unbound_H3K27me3 = 689 + 434
total_svbF7_bound_H3K27me3 = 487 + 302

percent_svbf7_H3K27me3_unbound = round(100 * 689 / total_svbF7_unbound_H3K27me3, 2 ) 
percent_svbf7_unbound_without_H3K27me3 = round(100 * 434 / total_svbF7_unbound_H3K27me3, 2 ) 

percent_svbf7_H3K27me3_bound = round(100 * 487 / total_svbF7_bound_H3K27me3, 2 ) 
percent_svbf7_bound_without_H3K27me3 = round(100 * 302 / total_svbF7_bound_H3K27me3, 2 ) 


etat_svb = c("svbF7_bound","svbF7_unbound")
H3K27me3_absent = c(percent_svbf7_bound_without_H3K27me3,percent_svbf7_unbound_without_H3K27me3)

H3K27me3_present = c(percent_svbf7_H3K27me3_bound,percent_svbf7_H3K27me3_unbound)

data_H3K27me3 = data.frame(etat_svb,H3K27me3_absent,H3K27me3_present)
datatable(data_H3K27me3,rownames = F,filter = "none",colnames = c("Regions without H3K27me3","Regions with H3K27me3" ))
fig2 = plot_ly(data_H3K27me3, x = ~etat_svb,y = ~H3K27me3_present, type = "bar",name = "H3K27me3 present", color = I("purple"))
fig2 = fig2 %>% add_trace(y = ~H3K27me3_absent, name = "H3K27me3 absent", color = I("grey"))
fig2 = fig2 %>% layout(yaxis = list(title = "percent"))
fig2 = fig2 %>% layout(title = "H3K27me3 enrichment on svbF7 bound or not by Svb", barmode = "stack")
fig2
fig2 = plot_ly(data_H3K27me3, x = ~etat_svb,y = ~H3K27me3_present, type = "bar",name = "H3K27me3 present", color = I("purple"))
fig2 = fig2 %>% add_trace(y = ~H3K27me3_absent, name = "H3K27me3 absent", color = I("grey"))
fig2 = fig2 %>% layout(yaxis = list(title = "percent"))
fig2 = fig2 %>% layout(title = "H3K27me3 enrichment on svbF7 bound or not by Svb")
fig2

1.2.7.2 H3K4me1

1.2.7.2.1 8-12h
in H3K4me1 absent H3K4me1
in svbF7 unbound 933 190
absent svbF7 unbound 13651 5808
in H3K4me1 absent H3K4me1
in svbF7 bound 1120 0
absent svbF7 bound 13470 5456
pvalue_fixe = phyper(1120 - 1, 789, 20046 - 789, 14590)
pvalue_nonfixe = phyper(933 - 1, 1123, 20582 - 1123, 14584)
presence = c(1120,13470)
absence = c(0,5456)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K4me1_fixe_8_12 = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K4me1_fixe_8_12)

presence = c(933,13651)
absence = c(190,5808)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K4me1_nonfixe_8_12 = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K4me1_nonfixe_8_12)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 1

La pvalue du test de fisher pour les motifs fixé est de 1.825385410^{-160} Celle du test de fisher pour les motifs non fixé est de 2.344941810^{-22}`

total_svbF7_unbound_H3K4me1 = 933 + 190
total_svbF7_bound_H3K4me1 = 1120 + 0

percent_svbf7_H3K4me1_unbound = round(100 * 933 / total_svbF7_unbound_H3K4me1, 2 ) 
percent_svbf7_unbound_without_H3K4me1 = round(100 * 190 / total_svbF7_unbound_H3K4me1, 2 ) 

percent_svbf7_H3K4me1_bound = round(100 * 1120 / total_svbF7_bound_H3K4me1, 2 ) 
percent_svbf7_bound_without_H3K4me1 = round(100 * 0 / total_svbF7_bound_H3K4me1, 2 ) 


etat_svb = c("svbF7_bound","svbF7_unbound")
H3K4me1_absent = c(percent_svbf7_bound_without_H3K4me1,percent_svbf7_unbound_without_H3K4me1)

H3K4me1_present = c(percent_svbf7_H3K4me1_bound,percent_svbf7_H3K4me1_unbound)

data_H3K4me1 = data.frame(etat_svb,H3K4me1_absent,H3K4me1_present)
datatable(data_H3K4me1,rownames = F,filter = "none",colnames = c("Regions without H3K4me1","Regions with H3K4me1" ))
fig4 = plot_ly(data_H3K4me1, x = ~etat_svb,y = ~H3K4me1_present, type = "bar",name = "H3K4me1 present", color = I("orange"))
fig4 = fig4 %>% add_trace(y = ~H3K4me1_absent, name = "H3K4me1 absent", color = I("grey"))
fig4 = fig4 %>% layout(yaxis = list(title = "percent"))
fig4 = fig4 %>% layout(title = "H3K4me1 (embryo 8-12h) enrichment on svbF7 bound or not by Svb", barmode = "stack")
fig4
fig4 = plot_ly(data_H3K4me1, x = ~etat_svb,y = ~H3K4me1_present, type = "bar",name = "H3K4me1 present", color = I("orange"))
fig4 = fig4 %>% add_trace(y = ~H3K4me1_absent, name = "H3K4me1 absent", color = I("grey"))
fig4 = fig4 %>% layout(yaxis = list(title = "percent"))
fig4 = fig4 %>% layout(title = "H3K4me1 (embryo 8-12h) enrichment on svbF7 bound or not by Svb")
fig4
1.2.7.2.2 12-16h
in H3K4me1 absent H3K4me1
in svbF7 unbound 725 398
absent svbF7 unbound 11878 7878
in H3K4me1 absent H3K4me1
in svbF7 bound 1012 0
absent svbF7 bound 11597 7718
pvalue_fixe = phyper(1012 - 1, 789, 20327 - 789, 12603)
pvalue_nonfixe = phyper(725 - 1, 1123, 20879 - 1123, 12603)
presence = c(1012,11597)
absence = c(0,7718)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K4me1_fixe_12_16 = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K4me1_fixe_12_16)

presence = c(725,11878)
absence = c(398,7878)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K4me1_nonfixe_12_16 = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K4me1_nonfixe_12_16)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 0.9983645

La pvalue du test de fisher pour les motifs fixé est de 1.6056910^{-217} Celle du test de fisher pour les motifs non fixé est de 0.0031876`

total_svbF7_unbound_H3K4me1 = 725 + 398
total_svbF7_bound_H3K4me1 = 1012 + 0

percent_svbf7_H3K4me1_unbound = round(100 * 725 / total_svbF7_unbound_H3K4me1, 2 ) 
percent_svbf7_unbound_without_H3K4me1 = round(100 * 398 / total_svbF7_unbound_H3K4me1, 2 ) 

percent_svbf7_H3K4me1_bound = round(100 * 1012 / total_svbF7_bound_H3K4me1, 2 ) 
percent_svbf7_bound_without_H3K4me1 = round(100 * 0 / total_svbF7_bound_H3K4me1, 2 ) 


etat_svb = c("svbF7_bound","svbF7_unbound")
H3K4me1_absent = c(percent_svbf7_bound_without_H3K4me1,percent_svbf7_unbound_without_H3K4me1)

H3K4me1_present = c(percent_svbf7_H3K4me1_bound,percent_svbf7_H3K4me1_unbound)

data_H3K4me1 = data.frame(etat_svb,H3K4me1_absent,H3K4me1_present)
datatable(data_H3K4me1,rownames = F,filter = "none",colnames = c("Regions without H3K4me1","Regions with H3K4me1" ))
fig3 = plot_ly(data_H3K4me1, x = ~etat_svb,y = ~H3K4me1_present, type = "bar",name = "H3K4me1 present", color = I("orange"))
fig3 = fig3 %>% add_trace(y = ~H3K4me1_absent, name = "H3K4me1 absent", color = I("grey"))
fig3 = fig3 %>% layout(yaxis = list(title = "percent"))
fig3 = fig3 %>% layout(title = "H3K4me1 (embryo 12h-16h) enrichment on svbF7 bound or not by Svb", barmode = "stack")
fig3
fig3 = plot_ly(data_H3K4me1, x = ~etat_svb,y = ~H3K4me1_present, type = "bar",name = "H3K4me1 present", color = I("orange"))
fig3 = fig3 %>% add_trace(y = ~H3K4me1_absent, name = "H3K4me1 absent", color = I("grey"))
fig3 = fig3 %>% layout(yaxis = list(title = "percent"))
fig3 = fig3 %>% layout(title = "H3K4me1 (embryo 12h-16h) enrichment on svbF7 bound or not by Svb")
fig3

1.2.7.3 H3K4me3

1.2.7.3.1 8-12h
in H3K4me3 absent H3K4me3
in svbF7 unbound 296 827
absent svbF7 unbound 5876 12263
in H3K4me3 absent H3K4me3
in svbF7 bound 299 490
absent svbF7 bound 5873 12129
pvalue_fixe = phyper(299 - 1, 789, 18791 - 789, 6172)
pvalue_nonfixe = phyper(296 - 1, 789, 19262 - 1123, 6172)
presence = c(299,5873)
absence = c(490,12129)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K4me3_fixe_8_12 = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K4me3_fixe_8_12)

presence = c(296,586)
absence = c(398,7878)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K4me3_nonfixe_8_12 = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K4me3_nonfixe_8_12)

La pvalue du test de hypergéométrique pour les motifs fixé est de 0.9987244 Celle du test de hypergéométrique pour les motifs non fixé est de 0.9983399

La pvalue du test de fisher pour les motifs fixé est de 0.0022141 Celle du test de fisher pour les motifs non fixé est de 8.395345710^{-132}`

total_svbF7_unbound_H3K4me3 = 296 + 827
total_svbF7_bound_H3K4me3 = 299 + 490

percent_svbf7_H3K4me3_unbound = round(100 * 296 / total_svbF7_unbound_H3K4me3, 2 ) 
percent_svbf7_unbound_without_H3K4me3 = round(100 * 827 / total_svbF7_unbound_H3K4me3, 2 ) 

percent_svbf7_H3K4me3_bound = round(100 * 299 / total_svbF7_bound_H3K4me3, 2 ) 
percent_svbf7_bound_without_H3K4me3 = round(100 * 490 / total_svbF7_bound_H3K4me3, 2 ) 


etat_svb = c("svbF7_bound","svbF7_unbound")
H3K4me3_absent = c(percent_svbf7_bound_without_H3K4me3,percent_svbf7_unbound_without_H3K4me3)

H3K4me3_present = c(percent_svbf7_H3K4me3_bound,percent_svbf7_H3K4me3_unbound)

data_H3K4me3 = data.frame(etat_svb,H3K4me3_absent,H3K4me3_present)
datatable(data_H3K4me3,rownames = F,filter = "none",colnames = c("Regions without H3K4me3","Regions with H3K4me3" ))
fig3 = plot_ly(data_H3K4me3, x = ~etat_svb,y = ~H3K4me3_present, type = "bar",name = "H3K4me3 present" , color = I("pink"))
fig3 = fig3 %>% add_trace(y = ~H3K4me3_absent, name = "H3K4me3 absent", color = I("grey"))
fig3 = fig3 %>% layout(yaxis = list(title = "percent"))
fig3 = fig3 %>% layout(title = "H3K4me3 (embryo 8-12h) enrichment on svbF7 bound or not by Svb", barmode = "stack")
fig3
fig3 = plot_ly(data_H3K4me3, x = ~etat_svb,y = ~H3K4me3_present, type = "bar",name = "H3K4me3 present" , color = I("pink"))
fig3 = fig3 %>% add_trace(y = ~H3K4me3_absent, name = "H3K4me3 absent", color = I("grey"))
fig3 = fig3 %>% layout(yaxis = list(title = "percent"))
fig3 = fig3 %>% layout(title = "H3K4me3 (embryo 8-12h) enrichment on svbF7 bound or not by Svb")
fig3
1.2.7.3.1.1 Rapport K4me1/ K4me3
total_K4me1_8_12 = 14595
total_K4me3_8_12 = 6179
rapp_fixe_8_12 = round((contingence_H3K4me1_fixe_8_12[1,1]/total_K4me1_8_12) / (contingence_H3K4me3_fixe_8_12[1,1]/total_K4me3_8_12),2)
rapp_nonfixe_8_12 = round((contingence_H3K4me1_nonfixe[1,1]/total_K4me1_8_12) / (contingence_H3K4me3_nonfixe[1,1]/total_K4me3_8_12),2)

Il y a 1.59 fois de H3K4me1 que de H3K4me3 fixé.

Il y a 1.8 fois de H3K4me1 que de H3K4me3 non fixé.

1.2.7.3.2 12-16h
in H3K4me3 absent H3K4me3
in svbF7 unbound 299 824
absent svbF7 unbound 6467 12309
in H3K4me3 absent H3K4me3
in svbF7 bound 340 449
absent svbF7 bound 6427 12182
pvalue_fixe = phyper(340 - 1, 789, 19398 - 789, 6767)
pvalue_nonfixe = phyper(299 - 1, 1123, 19899 - 1123, 6766)
presence = c(340,6427)
absence = c(449,12182)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K4me3_fixe_12_16 = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K4me3_fixe_12_16)

presence = c(299,6467)
absence = c(824,12309)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K4me3_nonfixe_12_16 = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K4me3_nonfixe_12_16)

La pvalue du test de hypergéométrique pour les motifs fixé est de 0.9999993 Celle du test de hypergéométrique pour les motifs non fixé est de 1.828087910^{-8}

La pvalue du test de fisher pour les motifs fixé est de 1.210093210^{-6} Celle du test de fisher pour les motifs non fixé est de 4.834952910^{-8}`

total_svbF7_unbound_H3K4me3 = 299 + 824
total_svbF7_bound_H3K4me3 = 340 + 449

percent_svbf7_H3K4me3_unbound = round(100 * 299 / total_svbF7_unbound_H3K4me3, 2 ) 
percent_svbf7_unbound_without_H3K4me3 = round(100 * 824 / total_svbF7_unbound_H3K4me3, 2 ) 

percent_svbf7_H3K4me3_bound = round(100 * 340 / total_svbF7_bound_H3K4me3, 2 ) 
percent_svbf7_bound_without_H3K4me3 = round(100 * 449 / total_svbF7_bound_H3K4me3, 2 ) 


etat_svb = c("svbF7_bound","svbF7_unbound")
H3K4me3_absent = c(percent_svbf7_bound_without_H3K4me3,percent_svbf7_unbound_without_H3K4me3)

H3K4me3_present = c(percent_svbf7_H3K4me3_bound,percent_svbf7_H3K4me3_unbound)

data_H3K4me3 = data.frame(etat_svb,H3K4me3_absent,H3K4me3_present)
datatable(data_H3K4me3,rownames = F,filter = "none",colnames = c("Regions without H3K4me3","Regions with H3K4me3" ))
fig3 = plot_ly(data_H3K4me3, x = ~etat_svb,y = ~H3K4me3_present, type = "bar",name = "H3K4me3 present", color = I("pink"))
fig3 = fig3 %>% add_trace(y = ~H3K4me3_absent, name = "H3K4me3 absent", color = I("grey"))
fig3 = fig3 %>% layout(yaxis = list(title = "percent"))
fig3 = fig3 %>% layout(title = "H3K4me3 (embryo 12h-16h) enrichment on svbF7 bound or not by Svb", barmode = "stack")
fig3
fig3 = plot_ly(data_H3K4me3, x = ~etat_svb,y = ~H3K4me3_present, type = "bar",name = "H3K4me3 present", color = I("pink"))
fig3 = fig3 %>% add_trace(y = ~H3K4me3_absent, name = "H3K4me3 absent", color = I("grey"))
fig3 = fig3 %>% layout(yaxis = list(title = "percent"))
fig3 = fig3 %>% layout(title = "H3K4me3 (embryo 12h-16h) enrichment on svbF7 bound or not by Svb")
fig3
1.2.7.3.2.1 Rapport K4me1/ K4me3
total_K4me1_12_16 = 12613
total_K4me3_12_16 = 6775
rapp_fixe_12_16 = round((contingence_H3K4me1_fixe_8_12[1,1]/total_K4me1_12_16) / (contingence_H3K4me3_fixe_8_12[1,1]/total_K4me3_12_16),2)
rapp_nonfixe_12_16 = round((contingence_H3K4me1_nonfixe[1,1]/total_K4me1_12_16) / (contingence_H3K4me3_nonfixe[1,1]/total_K4me3_12_16),2)

Il y a 1.59 fois de H3K4me1 que de H3K4me3 fixé.

Il y a 1.8 fois de H3K4me1 que de H3K4me3 non fixé.

1.2.7.4 H3K27ac

1.2.7.4.1 8-12h
in H3K27ac absent H3K27ac
in svbF7 unbound 515 608
absent svbF7 unbound 9616 9778
in H3K27ac absent H3K27ac
in svbF7 bound 665 124
absent svbF7 bound 9467 9727
pvalue_fixe = phyper(665 - 1, 789, 19983 - 789, 10132)
pvalue_nonfixe = phyper(515 - 1, 1123, 20517 - 1123, 10131)
presence = c(665,9467)
absence = c(124,9727)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K27ac_fixe = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K27ac_fixe)

presence = c(515,9616)
absence = c(608,9778)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K27ac_nonfixe = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K27ac_nonfixe)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 0.0069799

La pvalue du test de fisher pour les motifs fixé est de 3.375421710^{-90} Celle du test de fisher pour les motifs non fixé est de 0.0153226`

total_svbF7_unbound_H3K27ac = 515 + 608
total_svbF7_bound_H3K27ac = 665 + 124

percent_svbf7_H3K27ac_unbound = round(100 * 515 / total_svbF7_unbound_H3K27ac, 2 ) 
percent_svbf7_unbound_without_H3K27ac = round(100 * 608 / total_svbF7_unbound_H3K27ac, 2 ) 

percent_svbf7_H3K27ac_bound = round(100 * 665 / total_svbF7_bound_H3K27ac, 2 ) 
percent_svbf7_bound_without_H3K27ac = round(100 * 124 / total_svbF7_bound_H3K27ac, 2 ) 


etat_svb = c("svbF7_bound","svbF7_unbound")
H3K27ac_absent = c(percent_svbf7_bound_without_H3K27ac,percent_svbf7_unbound_without_H3K27ac)

H3K27ac_present = c(percent_svbf7_H3K27ac_bound,percent_svbf7_H3K27ac_unbound)

data_H3K27ac = data.frame(etat_svb,H3K27ac_absent,H3K27ac_present)
datatable(data_H3K27ac,rownames = F,filter = "none",colnames = c("Regions without H3K27ac","Regions with H3K27ac" ))
fig3 = plot_ly(data_H3K27ac, x = ~etat_svb,y = ~H3K27ac_present, type = "bar",name = "H3K27ac present", color = I("blue"))
fig3 = fig3 %>% add_trace(y = ~H3K27ac_absent, name = "H3K27ac absent", color = I("grey"))
fig3 = fig3 %>% layout(yaxis = list(title = "percent"))
fig3 = fig3 %>% layout(title = "H3K27ac (embryo 8-12h) enrichment on svbF7 bound or not by Svb", barmode = "stack")
fig3
fig3 = plot_ly(data_H3K27ac, x = ~etat_svb,y = ~H3K27ac_present, type = "bar",name = "H3K27ac present", color = I("blue"))
fig3 = fig3 %>% add_trace(y = ~H3K27ac_absent, name = "H3K27ac absent", color = I("grey"))
fig3 = fig3 %>% layout(yaxis = list(title = "percent"))
fig3 = fig3 %>% layout(title = "H3K27ac (embryo 8-12h) enrichment on svbF7 bound or not by Svb")
fig3
1.2.7.4.2 12-16h
in H3K27ac absent H3K27ac
in svbF7 unbound 500 623
absent svbF7 unbound 9959 9790
in H3K27ac absent H3K27ac
in svbF7 bound 783 6
absent svbF7 bound 9676 9856
pvalue_fixe = phyper(783 - 1, 789, 20321 - 789, 10459)
pvalue_nonfixe = phyper(500 - 1, 1123, 20872 - 1123, 10459)
presence = c(665,9467)
absence = c(124,9727)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K27ac_fixe = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K27ac_fixe)

presence = c(515,9616)
absence = c(608,9778)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K27ac_nonfixe = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K27ac_nonfixe)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 5.152453810^{-5}

La pvalue du test de fisher pour les motifs fixé est de 3.375421710^{-90} Celle du test de fisher pour les motifs non fixé est de 0.0153226`

total_svbF7_unbound_H3K27ac = 500 + 623
total_svbF7_bound_H3K27ac = 783 + 6

percent_svbf7_H3K27ac_unbound = round(100 * 500 / total_svbF7_unbound_H3K27ac, 2 ) 
percent_svbf7_unbound_without_H3K27ac = round(100 * 623 / total_svbF7_unbound_H3K27ac, 2 ) 

percent_svbf7_H3K27ac_bound = round(100 * 783 / total_svbF7_bound_H3K27ac, 2 ) 
percent_svbf7_bound_without_H3K27ac = round(100 * 6 / total_svbF7_bound_H3K27ac, 2 ) 


etat_svb = c("svbF7_bound","svbF7_unbound")
H3K27ac_absent = c(percent_svbf7_bound_without_H3K27ac,percent_svbf7_unbound_without_H3K27ac)

H3K27ac_present = c(percent_svbf7_H3K27ac_bound,percent_svbf7_H3K27ac_unbound)

data_H3K27ac = data.frame(etat_svb,H3K27ac_absent,H3K27ac_present)
datatable(data_H3K27ac,rownames = F,filter = "none",colnames = c("Regions without H3K27ac","Regions with H3K27ac" ))
fig3 = plot_ly(data_H3K27ac, x = ~etat_svb,y = ~H3K27ac_present, type = "bar",name = "H3K27ac present", color = I("blue"))
fig3 = fig3 %>% add_trace(y = ~H3K27ac_absent, name = "H3K27ac absent", color = I("grey"))
fig3 = fig3 %>% layout(yaxis = list(title = "percent"))
fig3 = fig3 %>% layout(title = "H3K27ac (embryo 8-12h) enrichment on svbF7 bound or not by Svb", barmode = "stack")
fig3
data_H3K27ac = data.frame(etat_svb,H3K27ac_absent,H3K27ac_present)
datatable(data_H3K27ac,rownames = F,filter = "none",colnames = c("Regions without H3K27ac","Regions with H3K27ac" ))
fig3 = plot_ly(data_H3K27ac, x = ~etat_svb,y = ~H3K27ac_present, type = "bar",name = "H3K27ac present", color = I("blue"))
fig3 = fig3 %>% add_trace(y = ~H3K27ac_absent, name = "H3K27ac absent", color = I("grey"))
fig3 = fig3 %>% layout(yaxis = list(title = "percent"))
fig3 = fig3 %>% layout(title = "H3K27ac (embryo 8-12h) enrichment on svbF7 bound or not by Svb", barmode = "stack")
fig3

2 En Flankant les motifs de 300pb (taille des pics de Svb )

2.1 Determination des motifs ayant de la fixation ou non

2.1.1 Stringent

motif_svb_Bind_overlap_300 = findOverlapsOfPeaks(B1.peaks, ovoQ6_droso_gr_unique_300,svbF7_cons_gr_300)
makeVennDiagram(motif_svb_Bind_overlap_300,totalTest = 100,NameOfPeaks = c("SvbAct","ovoQ6", "svbF7"),fill=c("green","purple","orange"))

## $p.value
##      SvbAct ovoQ6 svbF7 pval
## [1,]      0     1     1  NaN
## [2,]      1     0     1  NaN
## [3,]      1     1     0  NaN
## 
## $vennCounts
##      SvbAct ovoQ6 svbF7 Counts count.B1.peaks count.ovoQ6_droso_gr_unique_300
## [1,]      0     0     0 -64227              0                               0
## [2,]      0     0     1    358              0                               0
## [3,]      0     1     0  56902              0                           56902
## [4,]      0     1     1   1645              0                            2869
## [5,]      1     0     0   2179           2179                               0
## [6,]      1     0     1     42             45                               0
## [7,]      1     1     0   2919           2971                            5012
## [8,]      1     1     1    282            317                             740
##      count.svbF7_cons_gr_300
## [1,]                       0
## [2,]                     358
## [3,]                       0
## [4,]                    1650
## [5,]                       0
## [6,]                      45
## [7,]                       0
## [8,]                     301
## attr(,"class")
## [1] "VennCounts"
ovoQ6_droso_svb_bind_overlap_300 = findOverlapsOfPeaks(B1.peaks,ovoQ6_droso_gr_unique_300)
makeVennDiagram(ovoQ6_droso_svb_bind_overlap_300,totalTest = 100,NameOfPeaks = c("SvbAct","ovoQ6"),fill=c("green","purple"))

## $p.value
##      SvbAct ovoQ6 pval
## [1,]      1     1  NaN
## 
## $vennCounts
##      SvbAct ovoQ6 Counts count.B1.peaks count.ovoQ6_droso_gr_unique_300
## [1,]      0     0 -65207              0                               0
## [2,]      0     1  59851              0                           59851
## [3,]      1     0   2227           2227                               0
## [4,]      1     1   3229           3285                            5672
## attr(,"class")
## [1] "VennCounts"
svbF7_cons_gr_svb_bind_overlap_300 = findOverlapsOfPeaks(B1.peaks,svbF7_cons_gr_300)
makeVennDiagram(svbF7_cons_gr_svb_bind_overlap_300,totalTest = 100,NameOfPeaks = c("SvbAct", "svbF7"),fill=c("green","orange"))

## $p.value
##      SvbAct svbF7 pval
## [1,]      1     1  NaN
## 
## $vennCounts
##      SvbAct svbF7 Counts count.B1.peaks count.svbF7_cons_gr_300
## [1,]      0     0  -7422              0                       0
## [2,]      0     1   2029              0                    2029
## [3,]      1     0   5187           5187                       0
## [4,]      1     1    306            325                     325
## attr(,"class")
## [1] "VennCounts"
svbF7_motifs_unbound_300 = as.data.frame(svbF7_cons_gr_svb_bind_overlap_300$peaklist$svbF7_cons_gr_300)

svbF7_motifs_bound_300 = as.data.frame(svbF7_cons_gr_svb_bind_overlap_300$peaklist$`B1.peaks///svbF7_cons_gr_300`)

ovoQ6_motifs_unbound_300 = as.data.frame(ovoQ6_droso_svb_bind_overlap_300$peaklist$ovoQ6_droso_gr_unique_300)

ovoQ6_motifs_bound_300 = as.data.frame(ovoQ6_droso_svb_bind_overlap_300$peaklist$`B1.peaks///ovoQ6_droso_gr_unique_300`)

2.1.2 Sensible

motif_svb_Bind_overlap_300_low = findOverlapsOfPeaks(SvbACT.peaks_low, ovoQ6_droso_gr_unique_300,svbF7_cons_gr_300)
makeVennDiagram(motif_svb_Bind_overlap_300_low,totalTest = 100,NameOfPeaks = c("SvbAct","ovoQ6", "svbF7"),fill=c("green","purple","orange"))

## $p.value
##      SvbAct ovoQ6 svbF7 pval
## [1,]      0     1     1  NaN
## [2,]      1     0     1  NaN
## [3,]      1     1     0  NaN
## 
## $vennCounts
##      SvbAct ovoQ6 svbF7 Counts count.SvbACT.peaks_low
## [1,]      0     0     0 -64446                      0
## [2,]      0     0     1    351                      0
## [3,]      0     1     0  55764                      0
## [4,]      0     1     1   1603                      0
## [5,]      1     0     0   2816                   2816
## [6,]      1     0     1     49                     51
## [7,]      1     1     0   3639                   3703
## [8,]      1     1     1    324                    368
##      count.ovoQ6_droso_gr_unique_300 count.svbF7_cons_gr_300
## [1,]                               0                       0
## [2,]                               0                     351
## [3,]                           55764                       0
## [4,]                            2781                    1608
## [5,]                               0                       0
## [6,]                               0                      52
## [7,]                            6133                       0
## [8,]                             845                     343
## attr(,"class")
## [1] "VennCounts"
ovoQ6_droso_svb_bind_overlap_300_low = findOverlapsOfPeaks(SvbACT.peaks_low,ovoQ6_droso_gr_unique_300)
makeVennDiagram(ovoQ6_droso_svb_bind_overlap_300_low,totalTest = 100,NameOfPeaks = c("SvbAct","ovoQ6"),fill=c("green","purple"))

## $p.value
##      SvbAct ovoQ6 pval
## [1,]      1     1  NaN
## 
## $vennCounts
##      SvbAct ovoQ6 Counts count.SvbACT.peaks_low count.ovoQ6_droso_gr_unique_300
## [1,]      0     0 -65396                      0                               0
## [2,]      0     1  58624                      0                           58624
## [3,]      1     0   2870                   2870                               0
## [4,]      1     1   4002                   4068                            6899
## attr(,"class")
## [1] "VennCounts"
svbF7_cons_gr_svb_bind_overlap_300_low = findOverlapsOfPeaks(SvbACT.peaks_low,svbF7_cons_gr_300)
makeVennDiagram(svbF7_cons_gr_svb_bind_overlap_300_low,totalTest = 100,NameOfPeaks = c("SvbAct", "svbF7"),fill=c("green","orange"))

## $p.value
##      SvbAct svbF7 pval
## [1,]      1     1  NaN
## 
## $vennCounts
##      SvbAct svbF7 Counts count.SvbACT.peaks_low count.svbF7_cons_gr_300
## [1,]      0     0  -8808                      0                       0
## [2,]      0     1   1986                      0                    1986
## [3,]      1     0   6573                   6573                       0
## [4,]      1     1    349                    365                     368
## attr(,"class")
## [1] "VennCounts"
svbF7_motifs_unbound_300_low = as.data.frame(svbF7_cons_gr_svb_bind_overlap_300_low$peaklist$svbF7_cons_gr_300)

svbF7_motifs_bound_300_low = as.data.frame(svbF7_cons_gr_svb_bind_overlap_300_low$peaklist$`SvbACT.peaks_low///svbF7_cons_gr_300`)

ovoQ6_motifs_unbound_300_low = as.data.frame(ovoQ6_droso_svb_bind_overlap_300_low$peaklist$ovoQ6_droso_gr_unique_300)

ovoQ6_motifs_bound_300_low = as.data.frame(ovoQ6_droso_svb_bind_overlap_300_low$peaklist$`SvbACT.peaks_low///ovoQ6_droso_gr_unique_300`)

2.1.3 Embryon

motif_svb_Bind_overlap_300_embryo = findOverlapsOfPeaks(SvbACT.peaks_embryo, ovoQ6_droso_gr_unique_300,svbF7_cons_gr_300)
makeVennDiagram(motif_svb_Bind_overlap_300_embryo,totalTest = 100,NameOfPeaks = c("SvbAct","ovoQ6", "svbF7"),fill=c("green","purple","orange"))

## $p.value
##      SvbAct ovoQ6 svbF7 pval
## [1,]      0     1     1  NaN
## [2,]      1     0     1  NaN
## [3,]      1     1     0  NaN
## 
## $vennCounts
##      SvbAct ovoQ6 svbF7 Counts count.SvbACT.peaks_embryo
## [1,]      0     0     0 -66627                         0
## [2,]      0     0     1    348                         0
## [3,]      0     1     0  56218                         0
## [4,]      0     1     1   1568                         0
## [5,]      1     0     0   4392                      4392
## [6,]      1     0     1     50                        53
## [7,]      1     1     0   3796                      3858
## [8,]      1     1     1    355                       403
##      count.ovoQ6_droso_gr_unique_300 count.svbF7_cons_gr_300
## [1,]                               0                       0
## [2,]                               0                     348
## [3,]                           56218                       0
## [4,]                            2734                    1572
## [5,]                               0                       0
## [6,]                               0                      52
## [7,]                            5686                       0
## [8,]                             885                     382
## attr(,"class")
## [1] "VennCounts"
ovoQ6_droso_svb_bind_overlap_300_embryo = findOverlapsOfPeaks(SvbACT.peaks_embryo,ovoQ6_droso_gr_unique_300)
makeVennDiagram(ovoQ6_droso_svb_bind_overlap_300_embryo,totalTest = 100,NameOfPeaks = c("SvbAct","ovoQ6"),fill=c("green","purple"))

## $p.value
##      SvbAct ovoQ6 pval
## [1,]      1     1  NaN
## 
## $vennCounts
##      SvbAct ovoQ6 Counts count.SvbACT.peaks_embryo
## [1,]      0     0 -67606                         0
## [2,]      0     1  59071                         0
## [3,]      1     0   4446                      4446
## [4,]      1     1   4189                      4260
##      count.ovoQ6_droso_gr_unique_300
## [1,]                               0
## [2,]                           59071
## [3,]                               0
## [4,]                            6452
## attr(,"class")
## [1] "VennCounts"
svbF7_cons_gr_svb_bind_overlap_300_embryo = findOverlapsOfPeaks(SvbACT.peaks_embryo,svbF7_cons_gr_300)
makeVennDiagram(svbF7_cons_gr_svb_bind_overlap_300_embryo,totalTest = 100,NameOfPeaks = c("SvbAct", "svbF7"),fill=c("green","orange"))

## $p.value
##      SvbAct svbF7 pval
## [1,]      1     1  NaN
## 
## $vennCounts
##      SvbAct svbF7 Counts count.SvbACT.peaks_embryo count.svbF7_cons_gr_300
## [1,]      0     0 -10537                         0                       0
## [2,]      0     1   1959                         0                    1959
## [3,]      1     0   8307                      8307                       0
## [4,]      1     1    371                       399                     395
## attr(,"class")
## [1] "VennCounts"
svbF7_motifs_unbound_300_embryo = as.data.frame(svbF7_cons_gr_svb_bind_overlap_300_embryo$peaklist$svbF7_cons_gr_300)

svbF7_motifs_bound_300_embryo = as.data.frame(svbF7_cons_gr_svb_bind_overlap_300_embryo$peaklist$`SvbACT.peaks_embryo///svbF7_cons_gr_300`)

ovoQ6_motifs_unbound_300_embryo = as.data.frame(ovoQ6_droso_svb_bind_overlap_300_embryo$peaklist$ovoQ6_droso_gr_unique_300)

ovoQ6_motifs_bound_300_embryo = as.data.frame(ovoQ6_droso_svb_bind_overlap_300_embryo$peaklist$`SvbACT.peaks_embryo///ovoQ6_droso_gr_unique_300`)

2.2 Comparaison avec les marques d’histones

2.2.1 Stringent

2.2.1.1 H3K27ac

in H3K27ac absent H3K27ac
in svbF7 unbound 167 1764
absent svbF7 unbound 4981 24285
in H3K27ac absent H3K27ac
in svbF7 bound 174 127
absent svbF7 bound 4979 25028
pvalue_fixe = phyper(174 - 1, 301, 30308 - 301, 5153) 
pvalue_nonfixe = phyper(167 - 1, 1931, 31197 - 1931, 5148)
presence = c(174,4979)
absence = c(127,25028)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K27ac_fixe = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K27ac_fixe)

presence = c(167,4981)
absence = c(1764,24285)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K27ac_nonfixe = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K27ac_nonfixe)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 1.632559610^{-25}

La pvalue du test de fisher pour les motifs fixé est de 6.336471410^{-58} Celle du test de fisher pour les motifs non fixé est de 7.33482810^{-25}`

total_svbF7_unbound_H3K27ac = 117 + 1773
total_svbF7_bound_H3K27ac = 214 + 128

percent_svbf7_H3K27ac_unbound = round(100 * 117 / total_svbF7_unbound_H3K27ac, 2 ) 
percent_svbf7_unbound_without_H3K27ac = round(100 * 1773 / total_svbF7_unbound_H3K27ac, 2 ) 

percent_svbf7_H3K27ac_bound = round(100 * 214 / total_svbF7_bound_H3K27ac, 2 ) 
percent_svbf7_bound_without_H3K27ac = round(100 * 128 / total_svbF7_bound_H3K27ac, 2 ) 



etat_svb = c("svbF7_bound","svb_unbound")
H3K27ac_absent = c(percent_svbf7_bound_without_H3K27ac,percent_svbf7_unbound_without_H3K27ac)

H3K27ac_present = c(percent_svbf7_H3K27ac_bound,percent_svbf7_H3K27ac_unbound)

data_H3K27ac = data.frame(etat_svb,H3K27ac_absent,H3K27ac_present)
datatable(data_H3K27ac,rownames = F,filter = "none",colnames = c("Regions without H3K27ac","Regions with H3K27ac" ))
fig1 = plot_ly(data_H3K27ac, x = ~etat_svb,y = ~H3K27ac_absent, type = "bar",name = "H3K27ac absent")
fig1 = fig1 %>% add_trace(y = ~H3K27ac_present, name = "H3K27ac present")
fig1 = fig1 %>% layout(yaxis = list(title = "percent"))
fig1 = fig1 %>% layout(title = "H3K27ac enrichment on svbF7 bound or not by Svb")
fig1
fig1 = plot_ly(data_H3K27ac, x = ~etat_svb,y = ~H3K27ac_absent, type = "bar",name = "H3K27ac absent")
fig1 = fig1 %>% add_trace(y = ~H3K27ac_present, name = "H3K27ac present")
fig1 = fig1 %>% layout(yaxis = list(title = "percent"))
fig1 = fig1 %>% layout(title = "H3K27ac enrichment on svbF7 bound or not by Svb", barmode = "stack")
fig1

2.2.1.2 H3K27me3

in H3K27me3 absent H3K27me3
in svbF7 unbound 736 1195
absent svbF7 unbound 12699 49770
in H3K27me3 absent H3K27me3
in svbF7 bound 48 253
absent svbF7 bound 13390 46987
pvalue_fixe = phyper(48 - 1, 301, 60678 - 301, 13438)
pvalue_nonfixe =phyper(736 - 1, 1931, 64400 - 1931, 13435)
presence = c(48,13390)
absence = c(253,46987)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K27me3_fixe = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K27me3_fixe)

presence = c(736,12699)
absence = c(1195,49770)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K27me3_nonfixe = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K27ac_nonfixe)

La pvalue du test de hypergéométrique pour les motifs fixé est de 0.0029026 Celle du test de hypergéométrique pour les motifs non fixé est de 1

La pvalue du test de fisher pour les motifs fixé est de 0.0081554 Celle du test de fisher pour les motifs non fixé est de 7.33482810^{-25}`

total_svbF7_unbound_H3K27me3 = 736 + 1195
total_svbF7_bound_H3K27me3 = 48 + 253

percent_svbf7_H3K27me3_unbound = round(100 * 736 / total_svbF7_unbound_H3K27me3, 2 ) 
percent_svbf7_unbound_without_H3K27me3 = round(100 * 1195 / total_svbF7_unbound_H3K27me3, 2 ) 

percent_svbf7_H3K27me3_bound = round(100 * 48 / total_svbF7_bound_H3K27me3, 2 ) 
percent_svbf7_bound_without_H3K27me3 = round(100 * 253 / total_svbF7_bound_H3K27me3, 2 ) 


etat_svb = c("svbF7_bound","svb_unbound")
H3K27me3_absent = c(percent_svbf7_bound_without_H3K27me3,percent_svbf7_unbound_without_H3K27me3)

H3K27me3_present = c(percent_svbf7_H3K27me3_bound,percent_svbf7_H3K27me3_unbound)

data_H3K27me3 = data.frame(etat_svb,H3K27me3_absent,H3K27me3_present)
datatable(data_H3K27me3,rownames = F,filter = "none",colnames = c("Regions without H3K27me3","Regions with H3K27me3" ))
fig2 = plot_ly(data_H3K27me3, x = ~etat_svb,y = ~H3K27me3_absent, type = "bar",name = "H3K27me3 absent")
fig2 = fig2 %>% add_trace(y = ~H3K27me3_present, name = "H3K27me3 present")
fig2 = fig2 %>% layout(yaxis = list(title = "percent"))
fig2 = fig2 %>% layout(title = "H3K27me3 enrichment on svbF7 bound or not by Svb")
fig2
fig2 = plot_ly(data_H3K27me3, x = ~etat_svb,y = ~H3K27me3_absent, type = "bar",name = "H3K27me3 absent")
fig2 = fig2 %>% add_trace(y = ~H3K27me3_present, name = "H3K27me3 present")
fig2 = fig2 %>% layout(yaxis = list(title = "percent"))
fig2 = fig2 %>% layout(title = "H3K27me3 enrichment on svbF7 bound or not by Svb", barmode = "stack")
fig2

2.2.1.3 H3K4me1

in H3K4me1 absent H3K4me1
in svbF7 unbound 321 1610
absent svbF7 unbound 8445 31802
in H3K4me1 absent H3K4me1
in svbF7 bound 211 90
absent svbF7 bound 8561 31674
pvalue_fixe = phyper(321 - 1, 1931, 42178 - 1931, 8766)
pvalue_nonfixe = phyper(211 - 1, 301, 40536 - 301, 8772)
presence = c(211,8561)
absence = c(90,31674)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K4me1_fixe = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K4me1_fixe)

presence = c(736,12699)
absence = c(1195,49770)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K4me1_nonfixe = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K4me1_nonfixe)

La pvalue du test de hypergéométrique pour les motifs fixé est de 9.840557510^{-7} Celle du test de hypergéométrique pour les motifs non fixé est de 1

La pvalue du test de fisher pour les motifs fixé est de 1.068099710^{-72} Celle du test de fisher pour les motifs non fixé est de 1.97416510^{-69}`

total_svbF7_unbound_H3K4me1 = 321 + 1610
total_svbF7_bound_H3K4me1 = 211 + 90

percent_svbf7_H3K4me1_unbound = round(100 * 321 / total_svbF7_unbound_H3K4me1, 2 ) 
percent_svbf7_unbound_without_H3K4me1 = round(100 * 1610  / total_svbF7_unbound_H3K4me1, 2 ) 

percent_svbf7_H3K4me1_bound = round(100 * 211 / total_svbF7_bound_H3K4me1, 2 ) 
percent_svbf7_bound_without_H3K4me1 = round(100 * 90 / total_svbF7_bound_H3K4me1, 2 ) 

etat_svb = c("svbF7_bound","svb_unbound")
H3K4me1_absent = c(percent_svbf7_bound_without_H3K4me1,percent_svbf7_unbound_without_H3K4me1)

H3K4me1_present = c(percent_svbf7_H3K4me1_bound,percent_svbf7_H3K4me1_unbound)

data_H3K4me1 = data.frame(etat_svb,H3K4me1_absent,H3K4me1_present)
datatable(data_H3K4me1,rownames = F,filter = "none",colnames = c("Regions without H3K4me1","Regions with H3K4me1" ))
fig3 = plot_ly(data_H3K4me1, x = ~etat_svb,y = ~H3K4me1_absent, type = "bar",name = "H3K4me1 absent")
fig3 = fig3 %>% add_trace(y = ~H3K4me1_present, name = "H3K4me1 present")
fig3 = fig3 %>% layout(yaxis = list(title = "percent"))
fig3 = fig3 %>% layout(title = "H3K4me1 enrichment on svbF7 bound or not by Svb")
fig3
fig3 = plot_ly(data_H3K4me1, x = ~etat_svb,y = ~H3K4me1_absent, type = "bar",name = "H3K4me1 absent")
fig3 = fig3 %>% add_trace(y = ~H3K4me1_present, name = "H3K4me1 present")
fig3 = fig3 %>% layout(yaxis = list(title = "percent"))
fig3 = fig3 %>% layout(title = "H3K4me1 enrichment on svbF7 bound or not by Svb", barmode = "stack")
fig3

2.2.1.4 H3K4me3

in H3K4me3 absent H3K4me3
in svbF7 unbound 69 1862
absent svbF7 unbound 4738 46371
in H3K4me3 absent H3K4me3
in svbF7 bound 109 192
absent svbF7 bound 4699 45486
pvalue_fixe = phyper(109 - 1, 301, 50486 - 301, 4808)
pvalue_nonfixe = phyper(69 - 1, 1931, 53040 - 1931, 4807)
presence = c(109,4699)
absence = c(192,45486)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K4me3_fixe = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K4me3_fixe)

presence = c(69,4738)
absence = c(1195,49770)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K4me3_nonfixe = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K4me3_nonfixe)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 2.268887910^{-22}

La pvalue du test de fisher pour les motifs fixé est de 2.306606710^{-36} Celle du test de fisher pour les motifs non fixé est de 2.425768410^{-5}`

total_svbF7_unbound_H3K4me3 = 69 + 1862
total_svbF7_bound_H3K4me3 = 109 + 192

percent_svbf7_H3K4me3_unbound = round(100 * 69 / total_svbF7_unbound_H3K4me3, 2 ) 
percent_svbf7_unbound_without_H3K4me3 = round(100 * 1862  / total_svbF7_unbound_H3K4me3, 2 ) 

percent_svbf7_H3K4me3_bound = round(100 * 109 / total_svbF7_bound_H3K4me3, 2 ) 
percent_svbf7_bound_without_H3K4me3 = round(100 * 192 / total_svbF7_bound_H3K4me3, 2 ) 

etat_svb = c("svbF7_bound","svb_unbound")
H3K4me3_absent = c(percent_svbf7_bound_without_H3K4me3,percent_svbf7_unbound_without_H3K4me3)

H3K4me3_present = c(percent_svbf7_H3K4me3_bound,percent_svbf7_H3K4me3_unbound)

data_H3K4me3 = data.frame(etat_svb,H3K4me3_absent,H3K4me3_present)
datatable(data_H3K4me3,rownames = F,filter = "none",colnames = c("Regions without H3K4me3","Regions with H3K4me3" ))
fig4 = plot_ly(data_H3K4me3, x = ~etat_svb,y = ~H3K4me3_absent, type = "bar",name = "H3K4me3 absent")
fig4 = fig4 %>% add_trace(y = ~H3K4me1_present, name = "H3K4me3 present")
fig4 = fig4 %>% layout(yaxis = list(title = "percent"))
fig4 = fig4 %>% layout(title = "H3K4me3 enrichment on svbF7 bound or not by Svb")
fig4
fig4 = plot_ly(data_H3K4me3, x = ~etat_svb,y = ~H3K4me3_absent, type = "bar",name = "H3K4me3 absent")
fig4 = fig4 %>% add_trace(y = ~H3K4me3_present, name = "H3K4me3 present")
fig4 = fig4 %>% layout(yaxis = list(title = "percent"))
fig4 = fig4 %>% layout(title = "H3K4me3 enrichment on svbF7 bound or not by Svb", barmode = "stack")
fig4
2.2.1.4.0.1 Rapport K4me1/ K4me3
rapp_fixe = round((contingence_H3K4me1_fixe[1,1]/total_K4me1_S2) / (contingence_H3K4me3_fixe[1,1]/total_K4me3_S2),2)
rapp_nonfixe = round((contingence_H3K4me1_nonfixe[1,1]/total_K4me1_S2) / (contingence_H3K4me3_nonfixe[1,1]/total_K4me3_S2),2)

Il y a 1.06 fois de H3K4me1 que de H3K4me3 fixé.

Il y a 5.84 fois de H3K4me1 que de H3K4me3 non fixé.

2.2.2 Sensible

2.2.2.1 H3K27ac

in H3K27ac absent H3K27ac
in svbF7 unbound 152 1738
absent svbF7 unbound 4996 24312
in H3K27ac absent H3K27ac
in svbF7 bound 190 152
absent svbF7 bound 4963 24886
pvalue_fixe = phyper(1190 - 1, 343, 30191 - 342, 5153)
pvalue_nonfixe = phyper(152 - 1, 1890, 31198 - 1890, 5148)
presence = c(190,4963)
absence = c(152,24886)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K27ac_fixe = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K27ac_fixe)

presence = c(152,4996)
absence = c(1738,24312)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K27ac_nonfixe = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K27ac_nonfixe)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 4.446086610^{-29}

La pvalue du test de fisher pour les motifs fixé est de 4.135509110^{-59} Celle du test de fisher pour les motifs non fixé est de 2.014332510^{-28}`

total_svbF7_unbound_H3K27ac = 122 + 1738
total_svbF7_bound_H3K27ac = 190 + 152

percent_svbf7_H3K27ac_unbound = round(100 * 122 / total_svbF7_unbound_H3K27ac, 2 ) 
percent_svbf7_unbound_without_H3K27ac = round(100 * 1738 / total_svbF7_unbound_H3K27ac, 2 ) 

percent_svbf7_H3K27ac_bound = round(100 * 190 / total_svbF7_bound_H3K27ac, 2 ) 
percent_svbf7_bound_without_H3K27ac = round(100 * 157 / total_svbF7_bound_H3K27ac, 2 ) 



etat_svb = c("svbF7_bound","svb_unbound")
H3K27ac_absent = c(percent_svbf7_bound_without_H3K27ac,percent_svbf7_unbound_without_H3K27ac)

H3K27ac_present = c(percent_svbf7_H3K27ac_bound,percent_svbf7_H3K27ac_unbound)

data_H3K27ac = data.frame(etat_svb,H3K27ac_absent,H3K27ac_present)
datatable(data_H3K27ac,rownames = F,filter = "none",colnames = c("Regions without H3K27ac","Regions with H3K27ac" ))
fig1 = plot_ly(data_H3K27ac, x = ~etat_svb,y = ~H3K27ac_absent, type = "bar",name = "H3K27ac absent")
fig1 = fig1 %>% add_trace(y = ~H3K27ac_present, name = "H3K27ac present")
fig1 = fig1 %>% layout(yaxis = list(title = "percent"))
fig1 = fig1 %>% layout(title = "H3K27ac enrichment on svbF7 bound or not by Svb")
fig1
fig1 = plot_ly(data_H3K27ac, x = ~etat_svb,y = ~H3K27ac_absent, type = "bar",name = "H3K27ac absent")
fig1 = fig1 %>% add_trace(y = ~H3K27ac_present, name = "H3K27ac present")
fig1 = fig1 %>% layout(yaxis = list(title = "percent"))
fig1 = fig1 %>% layout(title = "H3K27ac enrichment on svbF7 bound or not by Svb", barmode = "stack")
fig1

2.2.2.2 H3K27me3

in H3K27me3 absent H3K27me3
in svbF7 unbound 728 1162
absent svbF7 unbound 12707 49806
in H3K27me3 absent H3K27me3
in svbF7 bound 57 285
absent svbF7 bound 13381 46489
pvalue_fixe = phyper(57 - 1, 342, 60212 - 342, 13438)
pvalue_nonfixe = phyper(728 - 1, 1890, 64403 - 1890, 13435)
presence = c(57,13381)
absence = c(285,46489)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K27me3_fixe = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K27me3_fixe)

presence = c(7282,12707)
absence = c(1162,49806)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K27me3_nonfixe = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K27me3_nonfixe)

La pvalue du test de hypergéométrique pour les motifs fixé est de 0.0039024 Celle du test de hypergéométrique pour les motifs non fixé est de 1

La pvalue du test de fisher pour les motifs fixé est de 0.0110048 Celle du test de fisher pour les motifs non fixé est de 0`

total_svbF7_unbound_H3K27me3 = 728 + 1162
total_svbF7_bound_H3K27me3 = 57 + 285

percent_svbf7_H3K27me3_unbound = round(100 * 728 / total_svbF7_unbound_H3K27me3, 2 ) 
percent_svbf7_unbound_without_H3K27me3 = round(100 * 1162 / total_svbF7_unbound_H3K27me3, 2 ) 

percent_svbf7_H3K27me3_bound = round(100 * 57 / total_svbF7_bound_H3K27me3, 2 ) 
percent_svbf7_bound_without_H3K27me3 = round(100 * 285 / total_svbF7_bound_H3K27me3, 2 ) 


etat_svb = c("svbF7_bound","svb_unbound")
H3K27me3_absent = c(percent_svbf7_bound_without_H3K27me3,percent_svbf7_unbound_without_H3K27me3)

H3K27me3_present = c(percent_svbf7_H3K27me3_bound,percent_svbf7_H3K27me3_unbound)

data_H3K27me3 = data.frame(etat_svb,H3K27me3_absent,H3K27me3_present)
datatable(data_H3K27me3,rownames = F,filter = "none",colnames = c("Regions without H3K27me3","Regions with H3K27me3" ))
fig2 = plot_ly(data_H3K27me3, x = ~etat_svb,y = ~H3K27me3_absent, type = "bar",name = "H3K27me3 absent")
fig2 = fig2 %>% add_trace(y = ~H3K27me3_present, name = "H3K27me3 present")
fig2 = fig2 %>% layout(yaxis = list(title = "percent"))
fig2 = fig2 %>% layout(title = "H3K27me3 enrichment on svbF7 bound or not by Svb")
fig2
fig2 = plot_ly(data_H3K27me3, x = ~etat_svb,y = ~H3K27me3_absent, type = "bar",name = "H3K27me3 absent")
fig2 = fig2 %>% add_trace(y = ~H3K27me3_present, name = "H3K27me3 present")
fig2 = fig2 %>% layout(yaxis = list(title = "percent"))
fig2 = fig2 %>% layout(title = "H3K27me3 enrichment on svbF7 bound or not by Svb", barmode = "stack")
fig2

2.2.2.3 H3K4me1

in H3K4me1 absent H3K4me1
in svbF7 unbound 302 1588
absent svbF7 unbound 8464 31826
in H3K4me1 absent H3K4me1
in svbF7 bound 232 110
absent svbF7 bound 8540 31446
pvalue_fixe = phyper(232 - 1, 342, 40328 - 342, 8772)
pvalue_nonfixe = phyper(302 - 1, 1890, 42180 - 1890, 8766)
presence = c(232,8540)
absence = c(110,31446)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K4me1_fixe = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K4me1_fixe)

presence = c(302,8464)
absence = c(1588,31826)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K4me1_nonfixe = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K4me1_nonfixe)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 2.482721810^{-8}

La pvalue du test de fisher pour les motifs fixé est de 6.355519110^{-75} Celle du test de fisher pour les motifs non fixé est de 6.574769710^{-8}`

total_svbF7_unbound_H3K4me1 = 302 + 1588
total_svbF7_bound_H3K4me1 = 232 + 110

percent_svbf7_H3K4me1_unbound = round(100 * 321 / total_svbF7_unbound_H3K4me1, 2 ) 
percent_svbf7_unbound_without_H3K4me1 = round(100 * 1588  / total_svbF7_unbound_H3K4me1, 2 ) 

percent_svbf7_H3K4me1_bound = round(100 * 232 / total_svbF7_bound_H3K4me1, 2 ) 
percent_svbf7_bound_without_H3K4me1 = round(100 * 110 / total_svbF7_bound_H3K4me1, 2 ) 

etat_svb = c("svbF7_bound","svb_unbound")
H3K4me1_absent = c(percent_svbf7_bound_without_H3K4me1,percent_svbf7_unbound_without_H3K4me1)

H3K4me1_present = c(percent_svbf7_H3K4me1_bound,percent_svbf7_H3K4me1_unbound)

data_H3K4me1 = data.frame(etat_svb,H3K4me1_absent,H3K4me1_present)
datatable(data_H3K4me1,rownames = F,filter = "none",colnames = c("Regions without H3K4me1","Regions with H3K4me1" ))
fig3 = plot_ly(data_H3K4me1, x = ~etat_svb,y = ~H3K4me1_absent, type = "bar",name = "H3K4me1 absent")
fig3 = fig3 %>% add_trace(y = ~H3K4me1_present, name = "H3K4me1 present")
fig3 = fig3 %>% layout(yaxis = list(title = "percent"))
fig3 = fig3 %>% layout(title = "H3K4me1 enrichment on svbF7 bound or not by Svb")
fig3
fig3 = plot_ly(data_H3K4me1, x = ~etat_svb,y = ~H3K4me1_absent, type = "bar",name = "H3K4me1 absent")
fig3 = fig3 %>% add_trace(y = ~H3K4me1_present, name = "H3K4me1 present")
fig3 = fig3 %>% layout(yaxis = list(title = "percent"))
fig3 = fig3 %>% layout(title = "H3K4me1 enrichment on svbF7 bound or not by Svb", barmode = "stack")
fig3

2.2.2.4 H3K4me3

in H3K4me3 absent H3K4me3
in svbF7 unbound 60 1830
absent svbF7 unbound 4747 46405
in H3K4me3 absent H3K4me3
in svbF7 bound 119 223
absent svbF7 bound 4689 45133
pvalue_fixe = phyper(119 - 1, 342, 50164 - 342, 4808)
pvalue_nonfixe = phyper(728 - 1, 1890, 64403 - 1890, 13435)
presence = c(57,13381)
absence = c(285,46489)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K4me3_fixe = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K4me3_fixe)

presence = c(7282,12707)
absence = c(1162,49806)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K4me3_nonfixe = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K4me3_nonfixe)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 1

La pvalue du test de fisher pour les motifs fixé est de 0.0110048 Celle du test de fisher pour les motifs non fixé est de 0`

total_svbF7_unbound_H3K4me3 = 121 + 1206
total_svbF7_bound_H3K4me3 = 388 + 161

percent_svbf7_H3K4me3_unbound = round(100 * 121 / total_svbF7_unbound_H3K4me3, 2 ) 
percent_svbf7_unbound_without_H3K4me3 = round(100 * 1206  / total_svbF7_unbound_H3K4me3, 2 ) 

percent_svbf7_H3K4me3_bound = round(100 * 388 / total_svbF7_bound_H3K4me3, 2 ) 
percent_svbf7_bound_without_H3K4me3 = round(100 * 161 / total_svbF7_bound_H3K4me3, 2 ) 

etat_svb = c("svbF7_bound","svb_unbound")
H3K4me3_absent = c(percent_svbf7_bound_without_H3K4me3,percent_svbf7_unbound_without_H3K4me3)

H3K4me3_present = c(percent_svbf7_H3K4me3_bound,percent_svbf7_H3K4me3_unbound)

data_H3K4me3 = data.frame(etat_svb,H3K4me3_absent,H3K4me3_present)
datatable(data_H3K4me3,rownames = F,filter = "none",colnames = c("Regions without H3K4me3","Regions with H3K4me3" ))
fig4 = plot_ly(data_H3K4me3, x = ~etat_svb,y = ~H3K4me3_absent, type = "bar",name = "H3K4me3 absent")
fig4 = fig4 %>% add_trace(y = ~H3K4me1_present, name = "H3K4me3 present")
fig4 = fig4 %>% layout(yaxis = list(title = "percent"))
fig4 = fig4 %>% layout(title = "H3K4me3 enrichment on svbF7 bound or not by Svb")
fig4
fig4 = plot_ly(data_H3K4me3, x = ~etat_svb,y = ~H3K4me3_absent, type = "bar",name = "H3K4me3 absent")
fig4 = fig4 %>% add_trace(y = ~H3K4me3_present, name = "H3K4me3 present")
fig4 = fig4 %>% layout(yaxis = list(title = "percent"))
fig4 = fig4 %>% layout(title = "H3K4me3 enrichment on svbF7 bound or not by Svb", barmode = "stack")
fig4
2.2.2.4.0.1 Rapport K4me1/ K4me3
rapp_fixe = round((contingence_H3K4me1_fixe[1,1]/total_K4me1_S2) / (contingence_H3K4me3_fixe[1,1]/total_K4me3_S2),2)
rapp_nonfixe = round((contingence_H3K4me1_nonfixe[1,1]/total_K4me1_S2) / (contingence_H3K4me3_nonfixe[1,1]/total_K4me3_S2),2)

Il y a 2.23 fois de H3K4me1 que de H3K4me3 fixé.

Il y a 0.02 fois de H3K4me1 que de H3K4me3 non fixé.

2.2.3 Embryon

2.2.3.1 8-12h

2.2.3.1.1 H3K27ac
in H3K27ac absent H3K27ac
in svbF7 unbound 196 1670
absent svbF7 unbound 9935 107649
in H3K27ac absent H3K27ac
in svbF7 bound 65 303
absent svbF7 bound 10067 98675
pvalue_fixe = phyper(65 - 1, 368, 109110 - 368, 10132)
pvalue_nonfixe = phyper(196 - 1, 1866, 119450 - 1866, 10131)
presence = c(65,10067)
absence = c(303,98675)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K27ac_fixe = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K27ac_fixe)

presence = c(196,9935)
absence = c(1670,107649)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H327ac_nonfixe = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H327ac_nonfixe)

La pvalue du test de hypergéométrique pour les motifs fixé est de 0.9999996 Celle du test de hypergéométrique pour les motifs non fixé est de 0.9987769

La pvalue du test de fisher pour les motifs fixé est de 5.111577810^{-7} Celle du test de fisher pour les motifs non fixé est de 0.0022066`

total_svbF7_unbound_H3K27ac = 196 + 1670
total_svbF7_bound_H3K27ac = 65 + 303

percent_svbf7_H3K27ac_unbound = round(100 * 196 / total_svbF7_unbound_H3K27ac, 2 ) 
percent_svbf7_unbound_without_H3K27ac = round(100 * 1670 / total_svbF7_unbound_H3K27ac, 2 ) 

percent_svbf7_H3K27ac_bound = round(100 * 65 / total_svbF7_bound_H3K27ac, 2 ) 
percent_svbf7_bound_without_H3K27ac = round(100 * 303 / total_svbF7_bound_H3K27ac, 2 ) 



etat_svb = c("svbF7_bound","svb_unbound")
H3K27ac_absent = c(percent_svbf7_bound_without_H3K27ac,percent_svbf7_unbound_without_H3K27ac)

H3K27ac_present = c(percent_svbf7_H3K27ac_bound,percent_svbf7_H3K27ac_unbound)

data_H3K27ac = data.frame(etat_svb,H3K27ac_absent,H3K27ac_present)
datatable(data_H3K27ac,rownames = F,filter = "none",colnames = c("Regions without H3K27ac","Regions with H3K27ac" ))
fig1 = plot_ly(data_H3K27ac, x = ~etat_svb,y = ~H3K27ac_absent, type = "bar",name = "H3K27ac absent")
fig1 = fig1 %>% add_trace(y = ~H3K27ac_present, name = "H3K27ac present")
fig1 = fig1 %>% layout(yaxis = list(title = "percent"))
fig1 = fig1 %>% layout(title = "H3K27ac enrichment on svbF7 bound or not by Svb")
fig1
fig1 = plot_ly(data_H3K27ac, x = ~etat_svb,y = ~H3K27ac_absent, type = "bar",name = "H3K27ac absent")
fig1 = fig1 %>% add_trace(y = ~H3K27ac_present, name = "H3K27ac present")
fig1 = fig1 %>% layout(yaxis = list(title = "percent"))
fig1 = fig1 %>% layout(title = "H3K27ac enrichment on svbF7 bound or not by Svb", barmode = "stack")
fig1
2.2.3.1.2 H3K27me3
in H3K27me3 absent H3K27me3
in svbF7 unbound 255 1611
absent svbF7 unbound 6507 80721
in H3K27me3 absent H3K27me3
in svbF7 bound 38 330
absent svbF7 bound 6724 76125
pvalue_fixe = phyper(38 - 1, 368, 83217 - 368 , 6762)
pvalue_nonfixe = phyper(255 - 1, 1866, 89094 - 1866, 6762)
presence = c(30,6724)
absence = c(330,76125)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K27me3_fixe = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K27me3_fixe)

presence = c(255,6507)
absence = c(1611,80721)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K27me3_nonfixe = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K27me3_nonfixe)

La pvalue du test de hypergéométrique pour les motifs fixé est de 0.9232816 Celle du test de hypergéométrique pour les motifs non fixé est de 1

La pvalue du test de fisher pour les motifs fixé est de 0.8466164 Celle du test de fisher pour les motifs non fixé est de 8.067370810^{-20}`

total_svbF7_unbound_H3K27me3 = 255 + 1611
total_svbF7_bound_H3K27me3 = 38 + 330

percent_svbf7_H3K27me3_unbound = round(100 * 255 / total_svbF7_unbound_H3K27me3, 2 ) 
percent_svbf7_unbound_without_H3K27me3 = round(100 * 1611/ total_svbF7_unbound_H3K27me3, 2 ) 

percent_svbf7_H3K27me3_bound = round(100 * 38 / total_svbF7_bound_H3K27me3, 2 ) 
percent_svbf7_bound_without_H3K27me3 = round(100 * 330 / total_svbF7_bound_H3K27me3, 2 ) 


etat_svb = c("svbF7_bound","svb_unbound")
H3K27me3_absent = c(percent_svbf7_bound_without_H3K27me3,percent_svbf7_unbound_without_H3K27me3)

H3K27me3_present = c(percent_svbf7_H3K27me3_bound,percent_svbf7_H3K27me3_unbound)

data_H3K27me3 = data.frame(etat_svb,H3K27me3_absent,H3K27me3_present)
datatable(data_H3K27me3,rownames = F,filter = "none",colnames = c("Regions without H3K27me3","Regions with H3K27me3" ))
fig2 = plot_ly(data_H3K27me3, x = ~etat_svb,y = ~H3K27me3_absent, type = "bar",name = "H3K27me3 absent")
fig2 = fig2 %>% add_trace(y = ~H3K27me3_present, name = "H3K27me3 present")
fig2 = fig2 %>% layout(yaxis = list(title = "percent"))
fig2 = fig2 %>% layout(title = "H3K27me3 enrichment on svbF7 bound or not by Svb")
fig2
fig2 = plot_ly(data_H3K27me3, x = ~etat_svb,y = ~H3K27me3_absent, type = "bar",name = "H3K27me3 absent")
fig2 = fig2 %>% add_trace(y = ~H3K27me3_present, name = "H3K27me3 present")
fig2 = fig2 %>% layout(yaxis = list(title = "percent"))
fig2 = fig2 %>% layout(title = "H3K27me3 enrichment on svbF7 bound or not by Svb", barmode = "stack")
fig2
2.2.3.1.3 H3K4me1
in H3K4me1 absent H3K4me1
in svbF7 unbound 336 1530
absent svbF7 unbound 14247 105586
in H3K4me1 absent H3K4me1
in svbF7 bound 104 264
absent svbF7 bound 14483 96147
pvalue_fixe = phyper(336 - 1, 368, 121699 - 368, 14583)
pvalue_nonfixe = phyper(104 - 1, 1866, 110998 - 1866, 14587)
presence = c(104,14483)
absence = c(264,96147)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K4me1_fixe = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K4me1_fixe)

presence = c(336,14247)
absence = c(1530,105586)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K4me1_nonfixe = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K4me1_nonfixe)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 7.334647710^{-28}

La pvalue du test de fisher pour les motifs fixé est de 2.453873510^{-14} Celle du test de fisher pour les motifs non fixé est de 2.628965710^{-14}`

total_svbF7_unbound_H3K4me1 = 336 + 1530
total_svbF7_bound_H3K4me1 = 104 + 264

percent_svbf7_H3K4me1_unbound = round(100 * 336 / total_svbF7_unbound_H3K4me1, 2 ) 
percent_svbf7_unbound_without_H3K4me1 = round(100 * 1530 / total_svbF7_unbound_H3K4me1, 2 ) 

percent_svbf7_H3K4me1_bound = round(100 * 104 / total_svbF7_bound_H3K4me1, 2 ) 
percent_svbf7_bound_without_H3K4me1 = round(100 * 264 / total_svbF7_bound_H3K4me1, 2 ) 

etat_svb = c("svbF7_bound","svb_unbound")
H3K4me1_absent = c(percent_svbf7_bound_without_H3K4me1,percent_svbf7_unbound_without_H3K4me1)

H3K4me1_present = c(percent_svbf7_H3K4me1_bound,percent_svbf7_H3K4me1_unbound)

data_H3K4me1 = data.frame(etat_svb,H3K4me1_absent,H3K4me1_present)
datatable(data_H3K4me1,rownames = F,filter = "none",colnames = c("Regions without H3K4me1","Regions with H3K4me1" ))
fig3 = plot_ly(data_H3K4me1, x = ~etat_svb,y = ~H3K4me1_absent, type = "bar",name = "H3K4me1 absent")
fig3 = fig3 %>% add_trace(y = ~H3K4me1_present, name = "H3K4me1 present")
fig3 = fig3 %>% layout(yaxis = list(title = "percent"))
fig3 = fig3 %>% layout(title = "H3K4me1 enrichment on svbF7 bound or not by Svb")
fig3
fig3 = plot_ly(data_H3K4me1, x = ~etat_svb,y = ~H3K4me1_absent, type = "bar",name = "H3K4me1 absent")
fig3 = fig3 %>% add_trace(y = ~H3K4me1_present, name = "H3K4me1 present")
fig3 = fig3 %>% layout(yaxis = list(title = "percent"))
fig3 = fig3 %>% layout(title = "H3K4me1 enrichment on svbF7 bound or not by Svb", barmode = "stack")
fig3
2.2.3.1.4 H3K4me3
in H3K4me3 absent H3K4me3
in svbF7 unbound 114 1752
absent svbF7 unbound 6058 78680
in H3K4me3 absent H3K4me3
in svbF7 bound 48 320
absent svbF7 bound 6124 74548
pvalue_fixe = phyper(48 - 1, 368, 81040 - 368, 6172)
pvalue_nonfixe = phyper(114 - 1, 1866, 866004 - 1866, 6172)
presence = c(48,6124)
absence = c(320,74548)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K4me3_fixe = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K4me3_fixe)

presence = c(114,6058)
absence = c(1752,78680)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K4me3_nonfixe = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K4me3_nonfixe)

La pvalue du test de hypergéométrique pour les motifs fixé est de 0.999802 Celle du test de hypergéométrique pour les motifs non fixé est de 1

La pvalue du test de fisher pour les motifs fixé est de 3.404928210^{-4} Celle du test de fisher pour les motifs non fixé est de 0.0921426`

total_svbF7_unbound_H3K4me3 = 114 + 1752
total_svbF7_bound_H3K4me3 = 48 + 320

percent_svbf7_H3K4me3_unbound = round(100 * 114 / total_svbF7_unbound_H3K4me3, 2 ) 
percent_svbf7_unbound_without_H3K4me3 = round(100 * 1752  / total_svbF7_unbound_H3K4me3, 2 ) 

percent_svbf7_H3K4me3_bound = round(100 * 48 / total_svbF7_bound_H3K4me3, 2 ) 
percent_svbf7_bound_without_H3K4me3 = round(100 * 320 / total_svbF7_bound_H3K4me3, 2 ) 

etat_svb = c("svbF7_bound","svb_unbound")
H3K4me3_absent = c(percent_svbf7_bound_without_H3K4me3,percent_svbf7_unbound_without_H3K4me3)

H3K4me3_present = c(percent_svbf7_H3K4me3_bound,percent_svbf7_H3K4me3_unbound)

data_H3K4me3 = data.frame(etat_svb,H3K4me3_absent,H3K4me3_present)
datatable(data_H3K4me3,rownames = F,filter = "none",colnames = c("Regions without H3K4me3","Regions with H3K4me3" ))
fig4 = plot_ly(data_H3K4me3, x = ~etat_svb,y = ~H3K4me3_absent, type = "bar",name = "H3K4me3 absent")
fig4 = fig4 %>% add_trace(y = ~H3K4me1_present, name = "H3K4me3 present")
fig4 = fig4 %>% layout(yaxis = list(title = "percent"))
fig4 = fig4 %>% layout(title = "H3K4me3 enrichment on svbF7 bound or not by Svb")
fig4
fig4 = plot_ly(data_H3K4me3, x = ~etat_svb,y = ~H3K4me3_absent, type = "bar",name = "H3K4me3 absent")
fig4 = fig4 %>% add_trace(y = ~H3K4me3_present, name = "H3K4me3 present")
fig4 = fig4 %>% layout(yaxis = list(title = "percent"))
fig4 = fig4 %>% layout(title = "H3K4me3 enrichment on svbF7 bound or not by Svb", barmode = "stack")
fig4
2.2.3.1.5 Rapport K4me1/ K4me3
rapp_fixe = round((contingence_H3K4me1_fixe[1,1]/total_K4me1_8_12) / (contingence_H3K4me3_fixe[1,1]/total_K4me3_8_12),2)
rapp_nonfixe = round((contingence_H3K4me1_nonfixe[1,1]/total_K4me1_8_12) / (contingence_H3K4me3_nonfixe[1,1]/total_K4me3_8_12),2)

Il y a 0.92 fois de H3K4me1 que de H3K4me3 fixé.

Il y a 1.25 fois de H3K4me1 que de H3K4me3 non fixé.

2.2.3.2 12-16h

2.2.3.2.1 H3K27ac
in H3K27ac absent H3K27ac
in svbF7 unbound 184 1682
absent svbF7 unbound 10275 120495
in H3K27ac absent H3K27ac
in svbF7 bound 88 280
absent svbF7 bound 10371 109254
pvalue_fixe = phyper(88 - 1, 368, 119993 - 368, 10459)
pvalue_nonfixe = phyper(184 - 1, 1866, 132606 - 1866, 10459)
presence = c(88,10371)
absence = c(280,109254)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K27ac_fixe = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K27ac_fixe)

presence = c(184,10275)
absence = c(1682,120495)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K27ac_nonfixe = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K27ac_nonfixe)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 0.9988463

La pvalue du test de fisher pour les motifs fixé est de 2.205439110^{-18} Celle du test de fisher pour les motifs non fixé est de 0.0021011`

total_svbF7_unbound_H3K27ac = 184 + 1682
total_svbF7_bound_H3K27ac = 88 + 280

percent_svbf7_H3K27ac_unbound = round(100 * 184 / total_svbF7_unbound_H3K27ac, 2 ) 
percent_svbf7_unbound_without_H3K27ac = round(100 * 1682 / total_svbF7_unbound_H3K27ac, 2 ) 

percent_svbf7_H3K27ac_bound = round(100 * 88 / total_svbF7_bound_H3K27ac, 2 ) 
percent_svbf7_bound_without_H3K27ac = round(100 * 280 / total_svbF7_bound_H3K27ac, 2 ) 



etat_svb = c("svbF7_bound","svb_unbound")
H3K27ac_absent = c(percent_svbf7_bound_without_H3K27ac,percent_svbf7_unbound_without_H3K27ac)

H3K27ac_present = c(percent_svbf7_H3K27ac_bound,percent_svbf7_H3K27ac_unbound)

data_H3K27ac = data.frame(etat_svb,H3K27ac_absent,H3K27ac_present)
datatable(data_H3K27ac,rownames = F,filter = "none",colnames = c("Regions without H3K27ac","Regions with H3K27ac" ))
fig1 = plot_ly(data_H3K27ac, x = ~etat_svb,y = ~H3K27ac_absent, type = "bar",name = "H3K27ac absent")
fig1 = fig1 %>% add_trace(y = ~H3K27ac_present, name = "H3K27ac present")
fig1 = fig1 %>% layout(yaxis = list(title = "percent"))
fig1 = fig1 %>% layout(title = "H3K27ac enrichment on svbF7 bound or not by Svb")
fig1
fig1 = plot_ly(data_H3K27ac, x = ~etat_svb,y = ~H3K27ac_absent, type = "bar",name = "H3K27ac absent")
fig1 = fig1 %>% add_trace(y = ~H3K27ac_present, name = "H3K27ac present")
fig1 = fig1 %>% layout(yaxis = list(title = "percent"))
fig1 = fig1 %>% layout(title = "H3K27ac enrichment on svbF7 bound or not by Svb", barmode = "stack")
fig1
2.2.3.2.2 H3K27me3
in H3K27me3 absent H3K27me3
in svbF7 unbound 261 1605
absent svbF7 unbound 6345 76742
in H3K27me3 absent H3K27me3
in svbF7 bound 40 328
absent svbF7 bound 6566 72659
pvalue_fixe = phyper(40 - 1, 368, 79593 - 368, 6606)
pvalue_nonfixe = phyper(261 - 1, 1866, 84953 - 1866, 6606)
presence = c(40,6566)
absence = c(328,72659)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K27me3_fixe = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K27me3_fixe)

presence = c(261,6345)
absence = c(1605,76742)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K27me3_nonfixe = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K27me3_nonfixe)

La pvalue du test de hypergéométrique pour les motifs fixé est de 0.950963 Celle du test de hypergéométrique pour les motifs non fixé est de 1

La pvalue du test de fisher pour les motifs fixé est de 0.0871654 Celle du test de fisher pour les motifs non fixé est de 2.617652810^{-20}`

total_svbF7_unbound_H3K27me3 = 261 + 1605
total_svbF7_bound_H3K27me3 = 40 + 328

percent_svbf7_H3K27me3_unbound = round(100 * 261 / total_svbF7_unbound_H3K27me3, 2 ) 
percent_svbf7_unbound_without_H3K27me3 = round(100 * 1605 / total_svbF7_unbound_H3K27me3, 2 ) 

percent_svbf7_H3K27me3_bound = round(100 * 40 / total_svbF7_bound_H3K27me3, 2 ) 
percent_svbf7_bound_without_H3K27me3 = round(100 * 328 / total_svbF7_bound_H3K27me3, 2 ) 


etat_svb = c("svbF7_bound","svb_unbound")
H3K27me3_absent = c(percent_svbf7_bound_without_H3K27me3,percent_svbf7_unbound_without_H3K27me3)

H3K27me3_present = c(percent_svbf7_H3K27me3_bound,percent_svbf7_H3K27me3_unbound)

data_H3K27me3 = data.frame(etat_svb,H3K27me3_absent,H3K27me3_present)
datatable(data_H3K27me3,rownames = F,filter = "none",colnames = c("Regions without H3K27me3","Regions with H3K27me3" ))
fig2 = plot_ly(data_H3K27me3, x = ~etat_svb,y = ~H3K27me3_absent, type = "bar",name = "H3K27me3 absent")
fig2 = fig2 %>% add_trace(y = ~H3K27me3_present, name = "H3K27me3 present")
fig2 = fig2 %>% layout(yaxis = list(title = "percent"))
fig2 = fig2 %>% layout(title = "H3K27me3 enrichment on svbF7 bound or not by Svb")
fig2
fig2 = plot_ly(data_H3K27me3, x = ~etat_svb,y = ~H3K27me3_absent, type = "bar",name = "H3K27me3 absent")
fig2 = fig2 %>% add_trace(y = ~H3K27me3_present, name = "H3K27me3 present")
fig2 = fig2 %>% layout(yaxis = list(title = "percent"))
fig2 = fig2 %>% layout(title = "H3K27me3 enrichment on svbF7 bound or not by Svb", barmode = "stack")
fig2
2.2.3.2.3 H3K4me1
in H3K4me1 absent H3K4me1
in svbF7 unbound 263 1603
absent svbF7 unbound 12340 118669
in H3K4me1 absent H3K4me1
in svbF7 bound 81 287
absent svbF7 bound 12562 107325
pvalue_fixe = phyper(81 - 1, 368, 120218 - 368, 12606)
pvalue_nonfixe = phyper(263 - 1, 1866, 132875 - 1866, 12603)
presence = c(263,12340)
absence = c(1603,118669)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K4me1_fixe = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K4me1_fixe)

presence = c(81,12562)
absence = c(287,107325)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K4me1_nonfixe = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K4me1_nonfixe)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 1

La pvalue du test de fisher pour les motifs fixé est de 1.235597210^{-10} Celle du test de fisher pour les motifs non fixé est de 1.269695310^{-10}`

total_svbF7_unbound_H3K4me1 = 263 + 1603
total_svbF7_bound_H3K4me1 = 81 + 287

percent_svbf7_H3K4me1_unbound = round(100 * 263 / total_svbF7_unbound_H3K4me1, 2 ) 
percent_svbf7_unbound_without_H3K4me1 = round(100 * 1603 / total_svbF7_unbound_H3K4me1, 2 ) 

percent_svbf7_H3K4me1_bound = round(100 * 81 / total_svbF7_bound_H3K4me1, 2 ) 
percent_svbf7_bound_without_H3K4me1 = round(100 * 287 / total_svbF7_bound_H3K4me1, 2 ) 

etat_svb = c("svbF7_bound","svb_unbound")
H3K4me1_absent = c(percent_svbf7_bound_without_H3K4me1,percent_svbf7_unbound_without_H3K4me1)

H3K4me1_present = c(percent_svbf7_H3K4me1_bound,percent_svbf7_H3K4me1_unbound)

data_H3K4me1 = data.frame(etat_svb,H3K4me1_absent,H3K4me1_present)
datatable(data_H3K4me1,rownames = F,filter = "none",colnames = c("Regions without H3K4me1","Regions with H3K4me1" ))
fig3 = plot_ly(data_H3K4me1, x = ~etat_svb,y = ~H3K4me1_absent, type = "bar",name = "H3K4me1 absent")
fig3 = fig3 %>% add_trace(y = ~H3K4me1_present, name = "H3K4me1 present")
fig3 = fig3 %>% layout(yaxis = list(title = "percent"))
fig3 = fig3 %>% layout(title = "H3K4me1 enrichment on svbF7 bound or not by Svb")
fig3
fig3 = plot_ly(data_H3K4me1, x = ~etat_svb,y = ~H3K4me1_absent, type = "bar",name = "H3K4me1 absent")
fig3 = fig3 %>% add_trace(y = ~H3K4me1_present, name = "H3K4me1 present")
fig3 = fig3 %>% layout(yaxis = list(title = "percent"))
fig3 = fig3 %>% layout(title = "H3K4me1 enrichment on svbF7 bound or not by Svb", barmode = "stack")
fig3
2.2.3.2.4 H3K4me3
in H3K4me3 absent H3K4me3
in svbF7 unbound 120 1746
absent svbF7 unbound 6646 92671
in H3K4me3 absent H3K4me3
in svbF7 bound 62 306
absent svbF7 bound 6705 86603
pvalue_fixe = phyper(62 - 1, 368, 93676 - 368, 6767)
pvalue_nonfixe = phyper(120 - 1, 1866, 101183 - 1866, 6766)
presence = c(120,6646)
absence = c(1746,92671)
svbF7 = c("in svbF7 bound", "absent svbF7 bound")
contingence_H3K4me3_fixe = data.frame(presence,absence, row.names = svbF7)
fisher = fisher.test(contingence_H3K4me3_fixe)

presence = c(120,6646)
absence = c(1746,92671)
svbF7 = c("in svbF7 unbound", "absent svbF7 unbound")
contingence_H3K4me3_nonfixe = data.frame(presence,absence, row.names = svbF7)
fisher_nonfixe = fisher.test(contingence_H3K4me3_nonfixe)

La pvalue du test de hypergéométrique pour les motifs fixé est de 1 Celle du test de hypergéométrique pour les motifs non fixé est de 0.3142804

La pvalue du test de fisher pour les motifs fixé est de 0.7081678 Celle du test de fisher pour les motifs non fixé est de 0.7081678`

total_svbF7_unbound_H3K4me3 = 120 + 1746
total_svbF7_bound_H3K4me3 = 62 + 306

percent_svbf7_H3K4me3_unbound = round(100 * 120 / total_svbF7_unbound_H3K4me3, 2 ) 
percent_svbf7_unbound_without_H3K4me3 = round(100 * 1746  / total_svbF7_unbound_H3K4me3, 2 ) 

percent_svbf7_H3K4me3_bound = round(100 * 62 / total_svbF7_bound_H3K4me3, 2 ) 
percent_svbf7_bound_without_H3K4me3 = round(100 * 306 / total_svbF7_bound_H3K4me3, 2 ) 

etat_svb = c("svbF7_bound","svb_unbound")
H3K4me3_absent = c(percent_svbf7_bound_without_H3K4me3,percent_svbf7_unbound_without_H3K4me3)

H3K4me3_present = c(percent_svbf7_H3K4me3_bound,percent_svbf7_H3K4me3_unbound)

data_H3K4me3 = data.frame(etat_svb,H3K4me3_absent,H3K4me3_present)
datatable(data_H3K4me3,rownames = F,filter = "none",colnames = c("Regions without H3K4me3","Regions with H3K4me3" ))
fig4 = plot_ly(data_H3K4me3, x = ~etat_svb,y = ~H3K4me3_absent, type = "bar",name = "H3K4me3 absent")
fig4 = fig4 %>% add_trace(y = ~H3K4me1_present, name = "H3K4me3 present")
fig4 = fig4 %>% layout(yaxis = list(title = "percent"))
fig4 = fig4 %>% layout(title = "H3K4me3 enrichment on svbF7 bound or not by Svb")
fig4
fig4 = plot_ly(data_H3K4me3, x = ~etat_svb,y = ~H3K4me3_absent, type = "bar",name = "H3K4me3 absent")
fig4 = fig4 %>% add_trace(y = ~H3K4me3_present, name = "H3K4me3 present")
fig4 = fig4 %>% layout(yaxis = list(title = "percent"))
fig4 = fig4 %>% layout(title = "H3K4me3 enrichment on svbF7 bound or not by Svb", barmode = "stack")
fig4
2.2.3.2.5 Rapport K4me1/ K4me3
rapp_fixe = round((contingence_H3K4me1_fixe[1,1]/total_K4me1_12_16) / (contingence_H3K4me3_fixe[1,1]/total_K4me3_12_16),2)
rapp_nonfixe = round((contingence_H3K4me1_nonfixe[1,1]/total_K4me1_12_16) / (contingence_H3K4me3_nonfixe[1,1]/total_K4me3_12_16),2)

Il y a 1.18 fois de H3K4me1 que de H3K4me3 fixé.

Il y a 0.36 fois de H3K4me1 que de H3K4me3 non fixé.

3 Conclusion

Lorsque l’on compare les motifs de fixation de Shavenbaby (svbF7 ou ovoQ6) et ses pics de fixation ( embryon, S2 ( sensible ou stringent)) nous observons que 70% à 85% des pics présentent des motifs svbF7 et/ou ovoQ6. Nous observons ensuite que ces motifs présentent des enrichissements en histones différents s’ils sont fixés ou non par Shavenbaby. Dans les cellules S2, les motifs svbF7 fixés par le facteur de transcription présentent un enrichissement en histone H3K27ac, H3K4me1 et H3K4me3. Les motifs fixés présentent un enrichissement en H3K4me1 plus fort qu’en H3K4me3, ce qui laisse à penser que Shavenbaby se fixe sur des régions enhancer préférentiellement. On observe que les motifs svbF7 non fixés en cellules S2 quant à eux présentent un enrichissement moindre en ces marques d’histones voire une absence totale. Ces motifs non fixés présentent un enrichissement en H3K27me3 alors que les motifs fixés n’en présentent pas ou peu. Ces observations sont valables que le motif soit agrandi de 3kb ou 300pb ( taille moyenne des pics). Dans les embryons (8-12h ou 12-16h), les motifs svbF7 fixés par Shavenbaby présentent un enrichissement en H3K4me1 et H3K27ac. Les motifs svbF7 présentent autant d’H3K27me3 ou de H3K4me3 qu’ils soient fixés ou non. En conclusion, les motifs svbF7 fixés présentent un enrichissement en H3K4me1 et H3K27ac qu’on observe en S2 ou en embryon.